Boost logo

Boost Users :

From: David Gruener (gruenedd_at_[hidden])
Date: 2005-04-28 09:09:26


Jeff Flinn wrote:
> A::A( const A::A& a ):mPimpl( new Impl( *a.mPimpl ) ){}
> and don't forget operator=;
> You get the deep copy semantics that your looking for don't you?

Then, whats the benefit here over using a plain pointer
or std::auto_ptr? The goal of using a smart pointer with
deep copy semantics is that you *dont* have to write
those stuff by yourself.

> I'd think scoped_ptr works above as well.

Again, scoped_ptr is noncopyable, and see above. :]

--David


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