http://forum.xentax.com/viewtopic.php?f=35&t=8223
<>
<!-- lang: cpp -->
#include <string>
#include <iostream> #include <sstream> using std::stringstream; using std::string; using std::wstring;
class Log { public: Log() { }
template <typename T>
Log&operator<<(T &t)
{
mSs<<t;
return *this;
}
Log&operator << (std::basic_ostream<char, std::char_traits<char> >&(*pf)(std::basic_ostream<char, std::char_traits<char> >&))
{
mSs<<pf;
return *this;
}
string toString()
{
return mSs.str();
}
private: stringstream mSs; };