/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Dan Marsden Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #if !defined(BOOST_FUSION_SWAP_20070501_1956) #define BOOST_FUSION_SWAP_20070501_1956 #include #include #include #include #include #include #include #include #include namespace boost { namespace fusion { namespace result_of { template struct swap : enable_if, traits::is_sequence > > {}; } namespace detail { struct swap { template struct result { typedef void type; }; template BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED void operator()(Elem const& e) const { using std::swap; swap(front(e), back(e)); } }; } template BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::swap::type swap(Seq1& lhs, Seq2& rhs) { typedef vector references; for_each(zip_view(references(lhs, rhs)), detail::swap()); } }} #endif