endl

Comparing address of std::endl

I am inspecting a piece of existing code and found out it behaves differently when compiled with Visual C++ 9 and MinGW: inline LogMsg& LogMsg::operator<<(std::ostream& (*p_manip)(std::ostream&) ) { if ( p_manip == static_cast< std::ostream& (*)(std::ostream&) > ( &std::endl<char, std::char_traits<char> >) ) { msg(m_outp...

C++ stream as a parameter when overloading operator<<

I'm trying to write my own logging class and use it as a stream: logger L; L << "whatever" << std::endl; This is the code I started with: #include <iostream> using namespace std; class logger{ public: template <typename T> friend logger& operator <<(logger& log, const T& value); }; template <typename T> logger& operator <...