From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ross Smith To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: libstdc++/3551: error in auto_ptr implementation Date: Tue, 03 Jul 2001 16:16:00 -0000 Message-id: <20010703231602.27888.qmail@sourceware.cygnus.com> X-SW-Source: 2001-07/msg00089.html List-Id: The following reply was made to PR libstdc++/3551; it has been noted by GNATS. From: Ross Smith To: 101371-quiet@bugs.debian.org Cc: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org Subject: Re: libstdc++/3551: error in auto_ptr implementation Date: Wed, 04 Jul 2001 11:13:54 +1200 Matthias Klose wrote: > > The code below does not compile with g++ 3.0, but it seems correct > judging by my C++ books. > > Wichert. > > #include > #include > using namespace std; > int main(int, char**) { > auto_ptr api(new int(5)); > list > lapi; > lapi.push_back(api); > return 0; > } This is not supposed to work. STL containers of auto_ptr are illegal (23.1 para 3, container elements must be CopyConstructible and Assignable; auto_ptr is neither). -- Ross Smith The Internet Group, Auckland, New Zealand ======================================================================== "Unix has always lurked provocatively in the background of the operating system wars, like the Russian Army." -- Neal Stephenson