Boost logo

Boost :

Subject: Re: [boost] unique_ptr for C++03
From: Jonathan Wakely (jwakely.boost_at_[hidden])
Date: 2013-08-09 04:06:40


On 8 August 2013 10:38, Andrew Ho wrote:
>
> Howard's implementation did bring something interesting up I noticed about
> the standard on array unique_ptr:
>
> There is no move constructor/assignment of the form:
>
> // constructor form here, similar issue with move assignment
> unique_ptr<T[], D>(move(unique_ptr<T[], U>))
>
> Assuming I'm interpreting the standard correctly, this technically is a
> compiler error even if U is implicitly convertible to D and D is not a
> reference (e.g. U == D&). This is not the case for single element
> unique_ptr. Single element unique ptr will copy-construct D if U is
> implicitly convertible and a reference.
>
> I don't know if this was intentionally done by the standards committee, or
> if it was a minor oversight. Howard's implementation does not allow this,
> GCC 4.8.1 allows this.
>
> Thoughts/comments on how we should handle this in boost? My current
> implementation follows GCC's implementation, but it is very easy to change.

I think this is probably because I implemented the proposed resolution
of http://cplusplus.github.io/LWG/lwg-active.html#2118 for GCC


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