Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-08-28 07:01:33


Matthias Kaeppler wrote:
> Peter Dimov wrote:
>> One reason is that the pointer constructor assumes ownership of the
>> pointer and as such, it imposes the requirement that the pointer has
>> to be delete-able.
> Not sure what you're getting at here. Do you mean, you want to avoid
> statements like:
> coll.insert(NULL); // coll is a collection of smart pointers
> ?

No, it's statements like

coll.insert( &x );
coll.insert( this );
coll.insert( p ); // where p doesn't come from new

that need to be avoided as they would lead to undefined behavior.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net