Matthias Klose wrote: > > The code below does not compile with g++ 3.0, but it seems correct > judging by my C++ books. > > Wichert. > > #include <memory> > #include <list> > using namespace std; > int main(int, char**) { > auto_ptr<int> api(new int(5)); > list<auto_ptr<int> > 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 <[EMAIL PROTECTED]> 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