++ 03: MimeLogger() << "Hello "
template <typename charT, class traits>
std::basic_ostream<charT, traits>& std::operator<< (
std::basic_ostream<charT, traits>& os,
const char* cstr);
, MimeLogger() . - , .
++ 11 rvalue-, , , ++ 11
template <typename charT, class traits, typename T>
std::basic_ostream<charT, traits>& std::operator<< (
std::basic_ostream<charT, traits>&& os,
const T& x );
<<, .
( g++ -std = ++ 0x.)
++ 11, class MimeLogger , , , ++ 03:
template<typename T>
MimeLogger& operator<<(const T& x)
{
static_cast<std::ostringstream&>(*this) << x;
return *this;
}
using std::ostringstream::operator<<;
- , , MimeLogger. , std::endl , std::endl ++. , ostream, (27.7.3.6.3):
namespace std {
template <typename charT, class traits>
class basic_ostream : {
public:
basic_ostream<charT, traits>& operator<<(
basic_ostream<charT,traits>& (*pf)(basic_ostream<charT,traits>&));
};
}