auto_ptr with vector doesn´t compile(gcc-2.95 19990602) - OK, my wrong assumption!

Marcel Ruff mr@forstware.de
Wed Jun 30 23:07:00 GMT 1999


"Martin v. Loewis" wrote:

> > 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
>
> 

Thanks Martin and Gabriel

Marcel



More information about the Gcc-bugs mailing list