Why does std::reference_wrapper<const T> not accept a temporary?
问题 Normally, rvalues can bind to const references ( const SomeType& ). It's built into the language. However, std::reference_wrapper<const T> does not accept an rvalue as its constructor argument since the corresponding overload is deliberately deleted. What is the reason for this inconsistency? std::reference_wrapper is "advertised" as the alternative to a reference variable for cases when we must pass by value but would like to preserve reference semantics. In other words, if the rvalue to