forked from boostorg/type_traits
Improve is_nothrow* tests.
Disable is_nothrow* full implementation when there's no SFINAE expressions and simplify implementation.
This commit is contained in:
1 parent
9de6a4924e
commit
5c0474dbc7
4 files changed
+39
-9
No files matched your search
@@ -16,7 +16,6 @@
|
||||
#include <boost/type_traits/has_nothrow_assign.hpp>
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/detail/ice_and.hpp>
|
||||
#include <boost/type_traits/detail/ice_or.hpp>
|
||||
#include <boost/type_traits/detail/ice_not.hpp>
|
||||
@@ -30,7 +29,7 @@ namespace boost {
|
||||
|
||||
namespace detail{
|
||||
|
||||
#ifndef BOOST_NO_CXX11_NOEXCEPT
|
||||
#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR)
|
||||
|
||||
template <class T, class Enable = void>
|
||||
struct false_or_cpp11_noexcept_move_assignable: public ::boost::false_type {};
|
||||
@@ -44,14 +43,22 @@ struct false_or_cpp11_noexcept_move_assignable <
|
||||
|
||||
template <class T>
|
||||
struct is_nothrow_move_assignable_imp{
|
||||
BOOST_STATIC_CONSTANT(bool, value = (
|
||||
::boost::type_traits::ice_and<
|
||||
::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value,
|
||||
::boost::type_traits::ice_not< ::boost::is_reference<T>::value >::value,
|
||||
::boost::detail::false_or_cpp11_noexcept_move_assignable<T>::value
|
||||
>::value));
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::false_or_cpp11_noexcept_move_assignable<T>::value);
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_nothrow_move_assignable_imp<T const> : public ::boost::false_type {};
|
||||
template <class T>
|
||||
struct is_nothrow_move_assignable_imp<T volatile> : public ::boost::false_type{};
|
||||
template <class T>
|
||||
struct is_nothrow_move_assignable_imp<T const volatile> : public ::boost::false_type{};
|
||||
template <class T>
|
||||
struct is_nothrow_move_assignable_imp<T&> : public ::boost::false_type{};
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class T>
|
||||
struct is_nothrow_move_assignable_imp<T&&> : public ::boost::false_type{};
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
template <class T>
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace boost {
|
||||
|
||||
namespace detail{
|
||||
|
||||
#ifndef BOOST_NO_CXX11_NOEXCEPT
|
||||
#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR)
|
||||
|
||||
template <class T, class Enable = void>
|
||||
struct false_or_cpp11_noexcept_move_constructible: public ::boost::false_type {};
|
||||
@@ -50,6 +50,13 @@ struct is_nothrow_move_constructible_imp{
|
||||
>::value));
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_nothrow_move_constructible_imp<volatile T> : public ::boost::false_type {};
|
||||
template <class T>
|
||||
struct is_nothrow_move_constructible_imp<const volatile T> : public ::boost::false_type{};
|
||||
template <class T>
|
||||
struct is_nothrow_move_constructible_imp<T&> : public ::boost::false_type{};
|
||||
|
||||
#else
|
||||
|
||||
template <class T>
|
||||
|
||||
Reference in new issue
Block a user