临时记事本

http://forum.xentax.com/viewtopic.php?f=35&t=8223

<>

<!-- lang: cpp -->
#include <string>

include

include

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;

};

你可能感兴趣的:(临时记事本)