I'm trying to overload my 'Log' class so that I can pass 'endl' to it. Given the obscure nature of the compiler errors for template classes, I'm not sure what to put on the 'right hand side'.
For example, these work fine. ..
Log & operator << (ostringstream & a)
{
writeLog(a.str());
return *this;
}
Log & operator << (const string & a)
{
writeLog(a);
return *this;
}
How do I do one that accepts endl?
This is the compiler's complaint:
line 62: Error: The operation "Log << std::basic_ostream<std::charT, std::traits>&(*)(std::basic_ostream<std::charT, std::traits>&)" is illegal.
<< moderator edit: added [code][/code] tags >>