Fallback for is_nothrow_swappable on pre-C++11

This commit is contained in:
Daniel James committed 2017-11-28 22:12:01 +00:00
1 parent 1146f73070
commit 3e9608230c
3 files changed
+66 -14

No files matched your search

@@ -10,6 +10,20 @@
#include <boost/config.hpp>
#if defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_DECLTYPE) || defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
#include <boost/type_traits/is_scalar.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/integral_constant.hpp>
namespace boost
{
template <class T> struct is_nothrow_swappable : boost::integral_constant<bool,
boost::is_scalar<T>::value && !boost::is_const<T>::value> {};
template <class T, class U> struct is_nothrow_swappable_with : false_type {};
template <class T> struct is_nothrow_swappable_with<T, T> : is_nothrow_swappable<T> {};
}
#else
#include <boost/type_traits/declval.hpp>