class logger {
....
};
logger& operator<<(logger& log, const std::string& str)
{
cout << "My Log: " << str << endl;
return log;
}
logger log;
log << "Lexicon Starting";
Works fine, but i would like to use a pointer to a class instance instead. i.e.
logger * log = new log();
log << "Lexicon Starting";
Is this possible? If so what is the syntax? Thanks
Edit: The compiler Error is
error: invalid operands of types 'logger*' and 'const char [17]' to binary 'operator<<'