
Daniel Frey <daniel.frey@aixigo.de> writes:
David Abrahams wrote:
Daniel Frey <daniel.frey@aixigo.de> writes:
David Abrahams wrote:
Not unless you make it generic: template< typename T > void reset( T& t ) { using std::swap; T x; swap(x, t); }
It depends on whether or not we expect users to provide swap() as a member function or as a free function for their own classes. We (meaning I) expect a free function :-)
Glad to hear that :)) It's just that I was under the impression that this is not the generally agreed on consensus here, but this might be misinterpretation on my side
I sure hope it is. A member function isn't generic because you can't use it to swap non-classes. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com