Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2008-07-12 18:42:35

On Jul 12, 2008, at 6:32 PM, Loïc Joly wrote:

> Sid Sacek a écrit :
>> Isn't the 'unique_ptr<>' a replacement for the standard C++
>> auto_ptr<> that's going to be deprecated in the next standard?
> It is both a replacement for std::auto_ptr & for boost::scoped_ptr :
> - It has single ownership, like scoped_ptr
> - It can transfert its ownership, like auto_ptr (but does so by move
> semantic, not by a a copy with a strange semantic).
> - It also has custom deleter semantic

And scoped_array functionality:

    unique_ptr<char[]> p(new char[3]);
    p[0] = 'a';


Example implementation:


Boost list run by bdawes at, gregod at, cpdaniel at, john at