3 Aug
2014
3 Aug
'14
1:28 p.m.
On Sun, Aug 3, 2014 at 4:55 PM, Andrey Semashev
boost::reference_wrapper will not construct from rvalues as of 1.56. std::reference_wrapper already doesn't.
OK, it's possible to write custom function
template
require these tricks, it should work transparently. I'm ok with leaving it vulnerable to incorrect use if it's not possible to protect it without sacrificing usability.
I'm not sure that one extra call [`print(unsafe_make_ref(getStr()))` instead of `print(getStr())`] is too high usability price for the safety in common case. Of course, it's only IMHO. -- Andrey