cannot access private members declared in class basic_ios<_Elem, _Traits>

I use std::fstream.

I get the following compiler error:
cannot access private members declared in class basic_ios<_Elem, _Traits>

When I go to the error trigger, I get the fstream inner file and the error is on this code:
1
2
3
private:
	_Myfb _Filebuffer;	// the file buffer
	};


I don't pass the fstream as value to any method.
Any ideas?
Show the code where you are calling/using the fstream object.

Aceix.
But the error is not on the code. It refers to the inner code of fstream.
The error may be depending on how you're using the fstream object, because if there were a problem with the std library, it would have been corrected a long time ago.

Aceix.
If the error is saying it cannot access the private data member then you should try making it a public variable to see if that will make a difference. If it absolutely needs to be private, then consider making a friend class for whatever is calling it.
Last edited on
Topic archived. No new replies allowed.