
12 Nov
2013
12 Nov
'13
7:34 a.m.
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. But boost::value_factory<T>::operator() did not accept rvalue, they take lvaue reference instead. Maybe it'll be better to provide another version of operator takes const lvalue? (Additionally, use std::forward to forward universal reference in C++11?) Sample code which compiler complains: int get_value(); struct var { var( ); explicit var(int); }; void caller() { boost::value_factory<var> f; f(get_value()); }