|
Boost : |
Subject: Re: [boost] [move][unique_ptr] c++14 unique_ptr comes to town
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2014-08-25 06:36:18
El 24/08/2014 18:31, Peter Dimov escribió:
> 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.)
Nice. You don't specialize the class, but just disallow some operations
depending on the single/array instantiation. It's much more compact ;-)
The boost::move implementation might be simplified with this approach.
> I intended to eventually bring this up to production quality and make it
> boost::unique_ptr, but couldn't spare the time.
Would you agree making boost::movelib::unique_ptr boost::unique_ptr? I
can think about some gradual steps.
Fast steps:
1) Change the namespace from boost::movelib:: to boost::
2) Create a boost/unique_ptr.hpp header redirecting to
boost/move/unique_ptr.hpp
3) Replace boost/make_unique.hpp redirecting to boost/move/make_unique
(this is breaking and would need consensus).
Slow steps (users should not notice any problem in the transition)
4) Decide if the implementation should live in boost/move or
boost/smart_ptr.
5) If we decide to move it to Boost.SmartPtr, start writing the docs,
pass the implementation and tests to SmartPtr test cases, etc.
Sounds ok? If so, I can prepare some pull requests to develop.
Best,
Ion
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk