I am writing a utility class to "unwrap" a std::reference_wrapper
, but I'm a bit conflicted as to what this means.
boost::unwrap_reference<T>::type
is defined as U
(where T
is std::reference_wrapper<U>
), but this seems counterintuitive. If a reference_wrapper
is meant to "wrap" a reference, then I would expect an "unwrapped" reference_wrapper
to be a reference.
Admittedly, this question may lead to opinion or conjecture, but is there any reason to prefer U
over U&
as the unwrapped type
(aside from following the model of boost)? Are there any technical reports which detail boost::unwrap_reference
that might provide a rationale for boost's model?