Subject: Re: [boost] [Boost.Move] A few notes
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2012-01-12 07:50:37
Dan Ivy wrote:
> Ultimately, this is what I suggest:
> First of all, have boost::move accept temporaries. Secondly, seriously
> consider changing the definition of BOOST_FWD_REF(T) from const T& to
> T&, as this would acheive two desirable, IMO, goals::
> a. Forwarding functions would accept modifiable lvalues (and keep them
> b. Forwarding functions would REJECT temporaries, UNLESS they're passed
> through boost::move, which assures that they're treated as rvalues.
Especially your point "a" reveals a different understanding of "boost::forward" and "BOOST_FWD_REF" than I gained during the review. My understanding was that the sole purpose of "boost::forward" and "BOOST_FWD_REF" is to enable "Constructor Forwarding" (see <http://www.boost.org/doc/libs/1_48_0/doc/html/move/construct_forwarding.html>). So the purpose of "boost::forward" is not to emulate "std::forward" for more general use cases.
The observation that Boost.Move doesn't play well enough with temporaries is important. It should at least be explained in the Boost.Move documentation. Whether it can/should be fixed or improved is a different question.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk