c++ - How do I use a class wstringstream variable? -


I have a wstring stream which I am using in my class as a type of buffer and it's a good Used by the part of this class, however, when I try to do this:

  #include & lt; Sstream & gt; Square foo {public: zero method a (int x, int y); // mBufferStream uses zero method B (int x, int y); // mBufferStream Personal Use: std :: wstringstream mBufferStream; }; I get the following error:  

Error C2248: 'std :: basic_ios & lt; _Elem, _Traits> :: basic_ios': Can not use private member declared in class Std :: basic_ios & lt; _Elem, _Traits> '

This is not my exact class explicitly, but is this a single setup any ideas as to what could I be wrong? I am using Microsoft Visual Studio 2005

[edit] In the PPP file, showing its usage in the method body (as an example of its use):

  void foo :: methodA (int x, int y) {mBufferStream & lt; & Lt; "From" & lt; & Lt; X & LT; & Lt; "To do" & lt; & Lt; Y; Externalfunction (mBufferStream.str ()); // print for mbufferStream.str (L ""); }   

The reason for this is by declaring a copy constructor for the compiler class Is foo . std :: wstringstream is noncopyable, as it is derived from ios_base .

Change it to your class:

  Include # & lt; Sstream & gt; Square foo {public: zero method a (int x, int y); // mBufferStream uses zero method B (int x, int y); // mBufferStream Personal Use: std :: wstringstream mBufferStream; Fu (Const Foo & amp; nbsp;); // non-cockpable zero operator = (constant foo and animation);  

And the compiler tells you on the offender.


Comments