Creating ostream manipulators for a specific class
- by petersohn
I have a class that is derived from ostream:
class my_ostream: public std::ostream
{
// ...
}
I want to make a manipulator (for example do_something), that works specifically to this class, like this:
my_ostream s;
s << "some text" << do_something << "some more text";
I did the following:
std::ostream…