Boost logo

Boost :

Subject: Re: [boost] [move] BOOST_RV_REF(TypeWithoutMoveEmulation) parameters
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2017-05-22 01:10:31

On 20/05/2017 02:16, Groke, Paul via Boost wrote:
> I'd like to use BOOST_RV_REF, with both C++98 and C++11 compilers,
> for some sink-functions, with types that are not "move-enabled". I.e.
> types that the sink can "consume"/"move from" by other means
> (swapping, calling .release(), ...). Some of them I can - eventually
> - change to befully move-enabled, others I can not (e.g. STL classes).
> I just assumed that this was possible by simply passing the argument
> with boost::move(arg). Apparently it's not though, because boost::move
> will return a plain T& for types without move emulation.
> For the time being I have defined my own helper function template
> "move_any" that will always return a rv<T>&.
> Is there such a function that I missed? And if not, would you think it'd make sense to provide one (I certainly think it would)?
> Regards,
> Paul Groke
> _______________________________________________
> Unsubscribe & other changes:

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