Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-04-28 12:29:37


Robert Marion wrote:
> So, I've been using std::auto_ptr for some time, and
> have always been careful to either create a copy
> constructor or make it private (same for assignment).
> But now that I am becoming a boost::shared_ptr
> convert, I think that is no longer necessary. Is that
> so?

It's not necessary if the generated copy constructor has the semantics that
you want. Keep in mind that all copies of shared_ptr refer to the same
pointee. So it depends on the context. If you aren't sure, disabling the
copy constructor is still a good guideline to apply by default.


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