diff options
Diffstat (limited to 'boost/type_traits/has_trivial_move_assign.hpp')
-rw-r--r-- | boost/type_traits/has_trivial_move_assign.hpp | 65 |
1 files changed, 40 insertions, 25 deletions
diff --git a/boost/type_traits/has_trivial_move_assign.hpp b/boost/type_traits/has_trivial_move_assign.hpp index db337f77e8..f7bb1987cb 100644 --- a/boost/type_traits/has_trivial_move_assign.hpp +++ b/boost/type_traits/has_trivial_move_assign.hpp @@ -11,47 +11,62 @@ #ifndef BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED -#include <boost/type_traits/config.hpp> +#include <boost/type_traits/intrinsics.hpp> +#include <boost/type_traits/integral_constant.hpp> + +#if !defined(BOOST_HAS_TRIVIAL_MOVE_ASSIGN) || defined(BOOST_MSVC) || defined(BOOST_INTEL) #include <boost/type_traits/is_pod.hpp> #include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_volatile.hpp> -#include <boost/type_traits/detail/ice_and.hpp> -#include <boost/type_traits/detail/ice_not.hpp> +#ifdef BOOST_MSVC +#include <boost/type_traits/is_reference.hpp> +#endif +#endif -// should be the last #include -#include <boost/type_traits/detail/bool_trait_def.hpp> +#if defined(__GNUC__) || defined(__clang) +#include <boost/type_traits/is_assignable.hpp> +#include <boost/type_traits/is_volatile.hpp> +#endif -namespace boost { +#ifdef __SUNPRO_CC +#include <boost/type_traits/is_assignable.hpp> +#include <boost/type_traits/remove_const.hpp> +#if __cplusplus >= 201103 +#define SOLARIS_EXTRA_CHECK && is_assignable<typename remove_const<T>::type&, typename remove_const<T>::type&&>::value +#endif +#endif + +#ifndef SOLARIS_EXTRA_CHECK +#define SOLARIS_EXTRA_CHECK +#endif -namespace detail { +namespace boost{ template <typename T> -struct has_trivial_move_assign_impl -{ +struct has_trivial_move_assign : public integral_constant<bool, #ifdef BOOST_HAS_TRIVIAL_MOVE_ASSIGN - BOOST_STATIC_CONSTANT(bool, value = (BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T))); + BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) #else - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::is_pod<T>::value, - ::boost::type_traits::ice_not< ::boost::is_const<T>::value >::value, - ::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value - >::value)); + ::boost::is_pod<T>::value && !::boost::is_const<T>::value && !::boost::is_volatile<T>::value SOLARIS_EXTRA_CHECK #endif -}; + > {}; -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_move_assign,T,::boost::detail::has_trivial_move_assign_impl<T>::value) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void,false) +template <> struct has_trivial_move_assign<void> : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void volatile,false) +template <> struct has_trivial_move_assign<void const> : public false_type{}; +template <> struct has_trivial_move_assign<void const volatile> : public false_type{}; +template <> struct has_trivial_move_assign<void volatile> : public false_type{}; +#endif +template <class T> struct has_trivial_move_assign<T&> : public false_type{}; +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +template <class T> struct has_trivial_move_assign<T&&> : public false_type{}; #endif +// Array types are not assignable: +template <class T, std::size_t N> struct has_trivial_move_assign<T[N]> : public false_type{}; +template <class T> struct has_trivial_move_assign<T[]> : public false_type{}; } // namespace boost -#include <boost/type_traits/detail/bool_trait_undef.hpp> +#undef SOLARIS_EXTRA_CHECK #endif // BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED |