auto_ptr with vector doesnôt compile(gcc-2.95 19990602)
Martin v. Loewis
martin@mira.isdn.cs.tu-berlin.de
Sat Jun 5 10:53:00 GMT 1999
> i believe the following little code is correct, but it wont compile
> (Linux glibc, gcc-2.95 19990602)
[...]
> typedef auto_ptr<string> StringP;
> typedef vector<StringP> MyVector;
Your code is incorrect. You must not build vectors of auto_ptr, since
they don't meet the CopyConstructable and Assignable properties of the
Standard Library container elements (ISO C++, [lib.auto.ptr]/3).
Regards,
Martin
More information about the Gcc-bugs
mailing list