1#ifndef BOOST_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_HPP_INCLUDED
2#define BOOST_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_HPP_INCLUDED
3
4// Copyright 2017 Peter Dimov
5//
6// Distributed under the Boost Software License, Version 1.0.
7// See accompanying file LICENSE_1_0.txt or copy at
8// http://www.boost.org/LICENSE_1_0.txt
9
10#include <boost/config.hpp>
11
12#if defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_DECLTYPE) \
13 || defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
14
15#include <boost/type_traits/is_scalar.hpp>
16#include <boost/type_traits/is_const.hpp>
17#include <boost/type_traits/integral_constant.hpp>
18
19namespace boost
20{
21template <class T> struct is_nothrow_swappable : boost::integral_constant<bool,
22 boost::is_scalar<T>::value && !boost::is_const<T>::value> {};
23
24template <class T, class U> struct is_nothrow_swappable_with : false_type {};
25template <class T> struct is_nothrow_swappable_with<T, T> : is_nothrow_swappable<T> {};
26}
27
28#else
29
30#include <boost/type_traits/detail/is_swappable_cxx_11.hpp>
31
32namespace boost
33{
34
35template<class T, class U> struct is_nothrow_swappable_with: boost_type_traits_swappable_detail::is_nothrow_swappable_with_helper<T, U>::type
36{
37};
38
39template<class T> struct is_nothrow_swappable: boost_type_traits_swappable_detail::is_nothrow_swappable_helper<T>::type
40{
41};
42
43} // namespace boost
44
45#endif
46
47#endif // #ifndef BOOST_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_HPP_INCLUDED
48

source code of include/boost/type_traits/is_nothrow_swappable.hpp