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