Is there anyway to write the following as a C++ macro?
- by anon
my_macro << 1 << "hello world" << blah->getValue() << std::endl;
should expand into:
std::ostringstream oss;
oss << 1 << "hello world" << blah->getValue() << std::endl;
ThreadSafeLogging(oss.str());
Thanks!
EDIT: the accepted answer is awesome. Can we upvote 8 more times and win this responder a badge?
(The answer only needs 6 more upvotes).
4 more votes to go from 21 to 25.
3 more. :-)
Victory. :-)