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-27 20:02:20


> In my implementation, I've went with perfect forwarding instead of the two
> constructor signatures described in the standard.

Actually, I'm not sure how you implement the standard requirement in C++03.
If you do that:

    The signature of these constructors depends upon whether D is a
reference type.
    If D is non-reference type A, then the signatures are:

    unique_ptr(pointer p, const A& d);
    unique_ptr(pointer p, A&& d);

(and it seems that you do) deleter rvalues will always bind to A const& in
C++03, never to rv<A>, as we saw in the recent thread. So it seems that

    unique_ptr<T>( p, D() )

will fail for a movable, noncopyable, D.

    unique_ptr<T>( p, move(d) )

will work though.


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