2 // Copyright Oliver Kowalke 2014.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef BOOST_CONTEXT_DETAIL_EXCHANGE_H
8 #define BOOST_CONTEXT_DETAIL_EXCHANGE_H
13 #include <boost/config.hpp>
15 #ifdef BOOST_HAS_ABI_HEADERS
16 # include BOOST_ABI_PREFIX
23 template< typename T, typename U = T >
24 T exchange( T & t, U && nv) {
26 t = std::forward< U >( nv);
32 #ifdef BOOST_HAS_ABI_HEADERS
33 #include BOOST_ABI_SUFFIX
36 #endif // BOOST_CONTEXT_DETAIL_EXCHANGE_H