How can I override a C++ standard-library class function? In my application, I use ofstream objects in many different places of code. And now I want to open files i
Another option would be to create a wrapper class that contains an 'ofstream' object and has the interface you want, and passes the work onto its 'oftstream' member. It would look like this.