28 Aug
2014
28 Aug
'14
12:02 a.m.
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.