Boost logo

Boost :

Subject: Re: [boost] [move][unique_ptr] c++14 unique_ptr comes to town
From: Peter Dimov (lists_at_[hidden])
Date: 2014-08-24 12:31:30


Ion Gaztañaga wrote:
> I would like to make this implementation the official boost::unique_ptr
> implementation, but until the community approves this, it's in
> boost::movelib namespace (boost::move it's a function so I needed to tweak
> the namespace name).

I actually have my own prototype implementation (attached) that I used to
test my ideas of how unique_ptr<T[]> and unique_ptr<T[N]> should behave with
respect to conversions between them (modeled after shared_ptr.)

It's however a prototype; meaning that it relies on C++11 features, does not
optimize out empty deleters, has no tests. I used the libc++ test suite to
test it, but that's not suitable for Boost.

It didn't occur to me that Howard has already written the test suite in a
more suitable form. :-)

I intended to eventually bring this up to production quality and make it
boost::unique_ptr, but couldn't spare the time.

> unique_ptr's "operator <" is implemented as x.get() < y.get() instead of
> std::less<CT>().

That exactly what I did too. :-)




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk