Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Function template adl_move_swap

boost::adl_move_swap

Synopsis

// In header: <boost/move/adl_move_swap.hpp>


template<typename T> void adl_move_swap(T & x, T & y);

Description

Exchanges the values of a and b, using Argument Dependent Lookup (ADL) to select a specialized swap function if available. If no specialized swap function is available, std::swap is used.

Exception: If T uses Boost.Move's move emulation and the compiler has no rvalue references then:

  • If T has a T::swap(T&) member, that member is called.

  • Otherwise a move-based swap is called, equivalent to: T t(::boost::move(x)); x = ::boost::move(y); y = ::boost::move(t);.


PrevUpHomeNext