Hi Thorsten,

Thanks for getting back to me. Unless I'm missing something, the examples indicate that a clone of an object is inserted when passed by reference. Please see the example page here:

http://www.boost.org/libs/ptr_container/doc/examples.html#id6

--snip--
5. Objects are cloned before insertion, inserted pointers are owned by the container
class X { ... };                     // assume 'X' is Clonable
X x;                                 // and 'X' can be stack-allocated
ptr_list<X> list;
list.push_back( x );                 // clone 'x' and then insert the resulting pointer
--snip--

Best regards,
--
Allen Cronce

Thorsten Ottosen wrote:
Allen Cronce <acronce <at> earthlink.net> writes:

  

No one responded to this so I'm sending it again.
I understand that the work around is to not use stack objects. But the
documentation indicates that this should work.
    

Ok, could you point to the documentation where this is stated, so I can remove
it?

It's not right; as can be seen from, only T* arguments are accepted by
push_back (in the next release auto_ptr<T> is probably supported too)

http://www.boost.org/libs/ptr_container/doc/ptr_sequence_adapter.html

br

Thorsten

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users