diff --git a/include/boost/optional/detail/old_optional_implementation.hpp b/include/boost/optional/detail/old_optional_implementation.hpp index 6d707fc..75d4bdc 100644 --- a/include/boost/optional/detail/old_optional_implementation.hpp +++ b/include/boost/optional/detail/old_optional_implementation.hpp @@ -17,6 +17,7 @@ #include #include #include +#include namespace boost { @@ -894,7 +895,7 @@ class optional : public optional_detail::optional_base BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && ::boost::is_nothrow_move_assignable::value) { // allow for Koenig lookup - boost::swap(*this, arg); + boost::core::invoke_swap(*this, arg); } diff --git a/include/boost/optional/detail/optional_swap.hpp b/include/boost/optional/detail/optional_swap.hpp index 2a7059e..f4eceab 100644 --- a/include/boost/optional/detail/optional_swap.hpp +++ b/include/boost/optional/detail/optional_swap.hpp @@ -13,7 +13,7 @@ #ifndef BOOST_OPTIONAL_DETAIL_OPTIONAL_SWAP_AJK_28JAN2015_HPP #define BOOST_OPTIONAL_DETAIL_OPTIONAL_SWAP_AJK_28JAN2015_HPP -#include +#include #include namespace boost { @@ -39,8 +39,8 @@ struct swap_selector else if ( !hasY ) y.emplace(); - // Boost.Utility.Swap will take care of ADL and workarounds for broken compilers - boost::swap(x.get(), y.get()); + // Boost.Core.Swap will take care of ADL and workarounds for broken compilers + boost::core::invoke_swap(x.get(), y.get()); if( !hasX ) y = boost::none ; @@ -64,13 +64,13 @@ struct swap_selector { template static void optional_swap ( optional& x, optional& y ) - //BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && BOOST_NOEXCEPT_EXPR(boost::swap(*x, *y))) + //BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && BOOST_NOEXCEPT_EXPR(boost::core::invoke_swap(*x, *y))) { if (x) { if (y) { - boost::swap(*x, *y); + boost::core::invoke_swap(*x, *y); } else { @@ -105,7 +105,7 @@ struct optional_swap_should_use_default_constructor : has_nothrow_default_constr template inline void swap ( optional& x, optional& y ) -//BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && BOOST_NOEXCEPT_EXPR(boost::swap(*x, *y))) +//BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && BOOST_NOEXCEPT_EXPR(boost::core::invoke_swap(*x, *y))) { optional_detail::swap_selector::value>::optional_swap(x, y); } diff --git a/include/boost/optional/optional.hpp b/include/boost/optional/optional.hpp index 56d50d7..f5fdf99 100644 --- a/include/boost/optional/optional.hpp +++ b/include/boost/optional/optional.hpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -1260,7 +1260,7 @@ class optional BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible::value && ::boost::is_nothrow_move_assignable::value) { // allow for Koenig lookup - boost::swap(*this, arg); + boost::core::invoke_swap(*this, arg); }