
David Abrahams wrote:
Daniel Frey <daniel.frey@aixigo.de> writes:
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. I tried to address this topic earlier here: <http://lists.boost.org/MailArchives/boost/msg52183.php> but got no satisfying answer. In fact I would prefer the above generic version, but it's not generic when UDTs provide a member function swap and std::swap kicks in and produces inefficient code. Regards, Daniel -- Daniel Frey aixigo AG - financial solutions & technology Schloß-Rahe-Straße 15, 52072 Aachen, Germany fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99 eMail: daniel.frey@aixigo.de, web: http://www.aixigo.de