
28 Jul
2004
28 Jul
'04
3:23 p.m.
Anthony Williams <anthony_w.geo@yahoo.com> writes:
The default implementation of swap is generally along the lines of
template<typename T> void swap(T& lhs,T& rhs) { T temp(lhs); lhs=rhs; rhs=temp; }
The initialization of temp creates a genuine copy of the data.
How so? Didn't you say that *i is a reference to a tuple of references? That makes T a tuple of references, and the initialization of a tuple of references just copies a bunch of pointers IIUC.
The two assignments then use the assignment operator of boost::tuple to assign through the references.
Does that make it clearer?
Not yet. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com