Is it valid to have a std::pair
of references ? In particular, are there issues with the assignment operator ? According to this link, there seems to be no special treatment with operator=, so default assignement operator will not be able to be generated.
I'd like to have a pair<T&, U&>
and be able to assign to it another pair (of values or references) and have the pointed-to objects modified.
In C++11 you can use std::pair<
std::reference_wrapper
<T>, std::reference_wrapper<U>>
and the objects of that type will behave exactly as you want.