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-28 16:26:38

Ion Gaztañaga wrote:
> > 85 template <class U>
> > 86 unique_ptr_data(P p, BOOST_FWD_REF(U) d) BOOST_NOEXCEPT
> > 87 : m_p(::boost::forward<U>(p)), d(::boost::forward<U>(d))
> > 88 {}
> >
> > It's not clear to me why you need this constructor (in addition to the
> > two others), and it's wrong - forward<U>(p) isn't likely to work.
> Apart from the useless "forward<>()" (which I think will work as pointers
> are not move-enabled),

Unless forward<U> ignores U, I don't see how it would work. The type of the
pointer is P, not U, which is not likely to be the same.

Boost list run by bdawes at, gregod at, cpdaniel at, john at