using fstream object created as class member
问题 I have an fstream object declared in my class like this (just an example): class Asd { public: Asd(); private: std::fstream stream; }; Now when the constructor is called I want to specify the fstream parameters like this Asd::Asd() { this->stream = std::fstream(file, std::fstream::in); } and then use that stream in all class functions that I have, but it doesn't work. One error VS is giving me is: no accessible path to private member declared in virtual base 'std::basic_ios<_Elem,_Traits>' So