swap temporary tuples of references
I'm writing a custom iterator that, when dereferenced returns a tuple of references. Since the tuple itself is ephemeral, I don't think I can return a reference from operator*(). I think my iterator makes sense semantically, since it has reference semantics, even though operator* returns a value. The issue is, when I try to call std::swap (or rather, when std::sort does), like below, I get errors because the swap expects l-values. Is there an easy fix to this problem? #include <vector> class test { public: test() :v1(10), v2(10) {} class iterator { public: iterator(std::vector<int>& _v1, std: