geekbrains_oop_cpp/lesson_6/exercise_2.hpp

33 lines
607 B
C++
Raw Normal View History

2021-07-08 14:54:37 +00:00
#ifndef EXERCISE_2_HPP_
#define EXERCISE_2_HPP_
#include <ostream>
//class endline
//{
//public:
// friend std::ostream& operator<<(std::ostream &out, const endline&);
//};
//
//std::ostream& operator<<(std::ostream &out, const endline& e)
//{
// out << "\n\n";
// out.flush();
//
// return out;
//}
//
//endline endll;
template<typename _CharT, typename _Traits>
inline std::basic_ostream<_CharT, _Traits>&
endll(std::basic_ostream<_CharT, _Traits>& __os)
{ return flush((__os.put(__os.widen('\n'))).put(__os.widen('\n'))); }
void exercise_2()
{
std::cout << "Hello" << endll << "world";
}
#endif