1
0
forked from boostorg/core

Try to include std::swap from the most lightweight header

Based on Boost.Move idea
This commit is contained in:
Nikita Kniazev
2019-12-01 17:26:58 +03:00
parent 38f71361fb
commit 868cb07578

View File

@ -23,10 +23,25 @@
#include <boost/core/enable_if.hpp>
#include <boost/config.hpp>
#include <utility> //for std::swap (C++11)
#include <algorithm> //for std::swap (C++98)
#include <cstddef> //for std::size_t
// try to include std::swap from the most lightweight header
#if defined(BOOST_DINKUMWARE_STDLIB)
# include <utility>
#elif defined(_LIBCPP_VERSION) // since the first commit
# include <type_traits>
#elif defined(__GLIBCXX__) && __GLIBCXX__ > 20080621 // GCC 4.4
# include <bits/move.h>
#elif defined(__GLIBCXX__) && __GLIBCXX__ > 20071010 // GCC 4.3
# include <bits/stl_move.h>
#elif defined(__GLIBCXX__) || defined(__GLIBCPP__) // && __GLIBCPP__ > 20001005 // GCC 2.97
# include <bits/stl_algobase.h>
#elif __cplusplus >= 201103L
# include <utility>
#else // C++98/03 fallback
# include <algorithm>
#endif
namespace boost_swap_impl
{
// we can't use type_traits here