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

Aug 28, 2014 at 10:19am
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?
Aug 28, 2014 at 10:41am
Show the code where you are calling/using the fstream object.

Aceix.
Aug 28, 2014 at 11:09am
But the error is not on the code. It refers to the inner code of fstream.
Aug 28, 2014 at 11:11am
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.
Aug 28, 2014 at 2:48pm
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 Aug 28, 2014 at 2:49pm
Topic archived. No new replies allowed.