|
Boost : |
Subject: Re: [boost] [Functional/Factory] Value factory not accepts rvalues?
From: THOMAS JORDAN (tomjordan766_at_[hidden])
Date: 2013-11-13 04:29:08
Lin, Yi-Li wrote:
> I found that boost::value_factory did not accept rvalues
> in some case.
> In my case, temporary value is produced and passed to
> value factory directly.
The documentation for Boost Functional/Factory states:
'For technical reasons the arguments to the function objects have to be
LValues. A factory that also accepts RValues can be composed using the
boost::forward_adapter or boost::bind.'
Your suggestion of using const lvalue (passing in non-const reference
wrappers where needed) seems to be the workaround for the C++03 perfect
forwarding problem that was employed by Boost smart_ptr::make_shared, not
sure why Functional/Factory took a different approach?
Tom.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk