Boost logo

Boost :

Subject: [boost] [core] A better boost::swap
From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2014-12-26 06:05:20

Hi all,

Ion Gaztañaga implemented a very good swap that used move emulation when
possible and has all the features of boost::swap:

I've tried to change default implementation of ::boost::swap to

#include <boost/move/adl_move_swap.hpp>
namespace boost
  template<class T1, class T2>
  void swap(T1& left, T2& right)
    ::boost::adl_move_swap(left, right);

All the tests of the Boost.Swap passed. Ion's solution looks better than
existing boost::swap.

Are there any reasons not to change the existing implementation of
Boost.Swap to Ion's version?

Best regards,
Antony Polukhin

Boost list run by bdawes at, gregod at, cpdaniel at, john at