inherit std::ostream
I want to define MyOStream which inherits publicly from std::ostream. Let's say I want to implement my own ofstream. How can this be done? I'll be glad for any help, coded example or any relevant link... thanks! I don't understand exactly what you're trying to accomplish here. User code shouldn't inherit from the streams themselves, as the streams are intended to provide a generalized locale specific conversion/"stringizing" facility. If you're trying to use an ostream which can write to a new buffer location (i.e. a gzip stream), then one should generally inherit from basic_streambuf instead,