I' am trying to correctly produce a tuple of std::reference_wrapper
s to objects. By using the technique shown here I manage to map the std::ref
function over all the original tuple, however, according to this (and it actually happens), std::reference_wrapper
s decay to plain refs (&) in the process. Is there a way to avoid this? I have a whole set of function that accept tuples of std::reference_wrapper
s and I'd rather not change them to use references.
Thanks
It is sufficient to do
tuple<reference_wrapper<T>...> = /* my tuple of references */;