This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: auto_ptr with vector doesn´t compile(gcc-2.95 19990602) - OK, my wrong assumption!
"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