X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=boost%2Ftuple%2Fdetail%2Ftuple_basic_no_partial_spec.hpp;fp=boost%2Ftuple%2Fdetail%2Ftuple_basic_no_partial_spec.hpp;h=7379bf818274dac92fc2ac3f26bf16dab612fbb1;hp=bb38662c4a6d916b539c76a49545bc23ea79a18a;hb=2d71eb92104693ca9baa5a2e1c23eeca776d8fd3;hpb=da57529b92adbb7ae74a89861cb39fb35ac7c62d diff --git a/boost/tuple/detail/tuple_basic_no_partial_spec.hpp b/boost/tuple/detail/tuple_basic_no_partial_spec.hpp index bb38662..7379bf8 100644 --- a/boost/tuple/detail/tuple_basic_no_partial_spec.hpp +++ b/boost/tuple/detail/tuple_basic_no_partial_spec.hpp @@ -27,6 +27,7 @@ #define BOOST_TUPLE_BASIC_NO_PARTIAL_SPEC_HPP #include "boost/type_traits.hpp" +#include "boost/utility/swap.hpp" #include #if defined BOOST_MSVC @@ -836,6 +837,29 @@ namespace tuples { detail::swallow_assign const ignore = detail::swallow_assign(); +template +void swap(tuple& lhs, + tuple& rhs); +inline void swap(null_type&, null_type&) {} +template +inline void swap(cons& lhs, cons& rhs) { + ::boost::swap(lhs.head, rhs.head); +} +template +inline void swap(cons& lhs, cons& rhs) { + ::boost::swap(lhs.head, rhs.head); + ::boost::tuples::swap(lhs.tail, rhs.tail); +} +template +inline void swap(tuple& lhs, + tuple& rhs) { + typedef tuple tuple_type; + typedef typename tuple_type::inherited base; + ::boost::tuples::swap(static_cast(lhs), static_cast(rhs)); +} + } // namespace tuples } // namespace boost #endif // BOOST_TUPLE_BASIC_NO_PARTIAL_SPEC_HPP