How can I derive a class from cout so that, for example, writing to it
cout
new_cout << \"message\";
would be equivalent to
You have to override operator<<(), but you even don't have to subclass std::cout. You may also create a new object or use existing objects like that.