I have a wstring stream that I'm using as sort of a buffer in my class and it is used by a good portion of the methods in this class. However, when I try to do something like this:
#include <sstream>
class foo
{
public:
void methodA(int x, int y); // Uses mBufferStream
void methodB(int x, int y); // Uses mBufferStream
private:
std::wstringstream mBufferStream;
};
I get the following error:
error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>'
This isn't my exact class obviously, but it is the same setup. Any thoughts as to what I may be doing wrong? I am using Microsoft Visual Studio 2005
[Edit] showing use in method body in .cpp file (as an example of it's use):
void foo::methodA(int x, int y)
{
mBufferStream << "From " << x << " To " << y;
externalfunction(mBufferStream.str()); // Prints to message service
mBufferStream.str(L"");
}