28 Aug
2014
28 Aug
'14
7:58 p.m.
El 28/08/2014 2:02, Peter Dimov escribió:
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.
Yes, thanks for pointing out that. For movable only types in C++03 using Boost.Move, we can detect that using an internal tag and change the signature to something that accepts rvalues, maybe (not tested). I'll add this to the to-do list. Best, Ion