Boost logo

Boost :

Subject: Re: [boost] [Boost.Move] A few notes
From: Dan Ivy (danivy.mail_at_[hidden])
Date: 2012-01-12 10:01:35

On Thu, Jan 12, 2012 at 2:50 PM, Thomas Klimpel
<Thomas.Klimpel_at_[hidden]> wrote:
> 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
>> modifiable).
>> 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 <>). So the purpose of "boost::forward" is not to emulate "std::forward" for more general use cases.

I don't see it. How is "constructor forwarding" any different than
"more general forwarding" in that respect, or, in any other respect?

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