How can I override an C++ standard-library class function?
问题 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 in a different permission mode in Linux, Ubuntu. But open function of ofstream has no parameter to specify the permission mode of the file it creats. Now I want to override open() function of ofstream class so it will get a parameter to specify the permissions for user access. 回答1: For starters, to clarify your terminology, the STL