Marc Schellens wrote:
I have (or better had) a class wich contains
a fstream (as a private member).
I made a vector of this class.
When I resize() the vector I got several error messages,
about some stuff being private int that context.
Is this gcc (3.2) specific or is there a 'official' reason for this?
The C++ iostreams classes are neither CopyConstructable nor Assignable.
So iostream objects cannot reside in objects / containers that require
these properties (e.g., STL containers). For example:
struct X { std::ofstream out; }
X x1, x2;
// Invoke 'X::X(const X&)' (i.e., class X's copy constructor)
X x3(x2); // ERROR -- member 'out' is not copyable
// Invoke 'X::operator=(const X&)'
x1 = x2; // ERROR -- member 'out' is not assignable
--
Jim
To reply by email, remove "link" and change "now.here" to "yahoo"
jfischer_link5809{at}now.here.com