Re: [boost] [Functional/Factory] Value factory not accepts rvalues?

13 Nov
2013
13 Nov
'13
9:29 a.m.
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.
4194
Age (days ago)
4194
Last active (days ago)
0 comments
1 participants
participants (1)
-
THOMAS JORDAN