Boost logo

Boost :

Subject: Re: [boost] [Boost.Move] A few notes
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2012-01-12 10:13:51


Dan Ivy wrote:
> "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.
>
> I don't see it. How is "constructor forwarding" any different than
> "more general forwarding" in that respect, or, in any other respect?

Well, the above documentation says "Fortunately, most constructors take arguments by value, by const-reference or by rvalue reference. If these limitations are accepted, ...".

Because perfect emulation of "std::forward" is not possible, the above reasoning allows to exclude the case of "non-const reference" arguments. For an arbitrary function, excluding the case of "non-const reference" arguments would be a total no-go.

Regards,
Thomas


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk