blob: 889598b38fdea9d34abe359c6948f71f9ac3d31b [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001
2// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
3// (C) Copyright Eric Friedman 2002-2003.
4// (C) Copyright Antony Polukhin 2013.
5// Use, modification and distribution are subject to the Boost Software License,
6// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt).
8//
9// See http://www.boost.org/libs/type_traits for most recent version including documentation.
10
11#ifndef BOOST_TT_IS_NOTHROW_MOVE_ASSIGNABLE_HPP_INCLUDED
12#define BOOST_TT_IS_NOTHROW_MOVE_ASSIGNABLE_HPP_INCLUDED
13
14#include <ndnboost/config.hpp>
15#include <ndnboost/type_traits/has_trivial_move_assign.hpp>
16#include <ndnboost/type_traits/has_nothrow_assign.hpp>
17#include <ndnboost/type_traits/is_array.hpp>
18#include <ndnboost/type_traits/is_reference.hpp>
19#include <ndnboost/type_traits/detail/ice_and.hpp>
20#include <ndnboost/type_traits/detail/ice_or.hpp>
21#include <ndnboost/type_traits/detail/ice_not.hpp>
22#include <ndnboost/utility/enable_if.hpp>
23#include <ndnboost/utility/declval.hpp>
24
25// should be the last #include
26#include <ndnboost/type_traits/detail/bool_trait_def.hpp>
27
28namespace ndnboost {
29
30namespace detail{
31
32#ifndef BOOST_NO_CXX11_NOEXCEPT
33
34template <class T, class Enable = void>
35struct false_or_cpp11_noexcept_move_assignable: public ::ndnboost::false_type {};
36
37template <class T>
38struct false_or_cpp11_noexcept_move_assignable <
39 T,
40 typename ::ndnboost::enable_if_c<sizeof(T) && BOOST_NOEXCEPT_EXPR(::ndnboost::declval<T&>() = ::ndnboost::declval<T>())>::type
41 > : public ::ndnboost::integral_constant<bool, BOOST_NOEXCEPT_EXPR(::ndnboost::declval<T&>() = ::ndnboost::declval<T>())>
42{};
43
44template <class T>
45struct is_nothrow_move_assignable_imp{
46 BOOST_STATIC_CONSTANT(bool, value = (
47 ::ndnboost::type_traits::ice_and<
48 ::ndnboost::type_traits::ice_not< ::ndnboost::is_volatile<T>::value >::value,
49 ::ndnboost::type_traits::ice_not< ::ndnboost::is_reference<T>::value >::value,
50 ::ndnboost::detail::false_or_cpp11_noexcept_move_assignable<T>::value
51 >::value));
52};
53
54#else
55
56template <class T>
57struct is_nothrow_move_assignable_imp{
58 BOOST_STATIC_CONSTANT(bool, value = (
59 ::ndnboost::type_traits::ice_and<
60 ::ndnboost::type_traits::ice_or<
61 ::ndnboost::has_trivial_move_assign<T>::value,
62 ::ndnboost::has_nothrow_assign<T>::value
63 >::value,
64 ::ndnboost::type_traits::ice_not< ::ndnboost::is_array<T>::value >::value
65 >::value));
66};
67
68#endif
69
70}
71
72BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_nothrow_move_assignable,T,::ndnboost::detail::is_nothrow_move_assignable_imp<T>::value)
73BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void,false)
74#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
75BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void const,false)
76BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void const volatile,false)
77BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void volatile,false)
78#endif
79
80} // namespace ndnboost
81
82#include <ndnboost/type_traits/detail/bool_trait_undef.hpp>
83
84#endif // BOOST_TT_IS_NOTHROW_MOVE_ASSIGNABLE_HPP_INCLUDED