diff --git a/include/boost/move/detail/type_traits.hpp b/include/boost/move/detail/type_traits.hpp index 5a09318..84dcbce 100644 --- a/include/boost/move/detail/type_traits.hpp +++ b/include/boost/move/detail/type_traits.hpp @@ -581,6 +581,28 @@ struct remove_cvref { }; +////////////////////////// +// is_unsigned +////////////////////////// +template struct is_unsigned_cv { static const bool value = true; }; +template <> struct is_unsigned_cv { static const bool value = false; }; +template <> struct is_unsigned_cv { static const bool value = false; }; +template <> struct is_unsigned_cv { static const bool value = false; }; +template <> struct is_unsigned_cv { static const bool value = false; }; +#ifdef BOOST_HAS_LONG_LONG +template <> struct is_unsigned_cv< ::boost::long_long_type > { static const bool value = false; }; +#endif + +#ifdef BOOST_HAS_INT128 +template <> struct is_unsigned_cv< ::boost::int128_type > { static const bool value = false; }; +#endif + +template +struct is_unsigned + : is_unsigned_cv::type> +{}; + + ////////////////////////// // make_unsigned ////////////////////////// @@ -594,6 +616,11 @@ template <> struct make_unsigned_impl { typedef uns template <> struct make_unsigned_impl< ::boost::long_long_type > { typedef ::boost::ulong_long_type type; }; #endif +#ifdef BOOST_HAS_INT128 +template <> struct make_unsigned_impl< ::boost::int128_type > { typedef ::boost::uint128_type type; }; +#endif + + template struct make_unsigned : make_unsigned_impl::type> @@ -639,6 +666,13 @@ template<> struct is_integral_cv< unsigned long>{ static const bool template<> struct is_integral_cv< ::boost:: long_long_type>{ static const bool value = true; }; template<> struct is_integral_cv< ::boost::ulong_long_type>{ static const bool value = true; }; #endif +#ifdef BOOST_HAS_INT128 +template <> struct is_integral_cv< ::boost::int128_type > { static const bool value = true; }; +template <> struct is_integral_cv< ::boost::uint128_type > { static const bool value = true; }; +#endif +#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L +template<> struct is_integral_cv { static const bool value = true; }; +#endif template struct is_integral @@ -660,13 +694,6 @@ template struct remove_all_extents { typedef typename remove_all_extents::type type;}; -////////////////////////// -// is_scalar -////////////////////////// -template -struct is_scalar -{ static const bool value = is_integral::value || is_floating_point::value; }; - ////////////////////////// // is_void ////////////////////////// @@ -732,6 +759,11 @@ struct is_nullptr_t : is_nullptr_t_cv::type> {}; +template +struct is_null_pointer + : is_nullptr_t_cv::type> +{}; + ////////////////////////////////////// // is_function ////////////////////////////////////// @@ -802,6 +834,7 @@ struct is_arithmetic is_integral::value; }; + ////////////////////////////////////// // is_member_function_pointer ////////////////////////////////////// @@ -829,21 +862,38 @@ struct is_member_function_pointer template struct is_enum_nonintrinsic { - static const bool value = !is_arithmetic::value && - !is_reference::value && - !is_class_or_union::value && - !is_array::value && - !is_void::value && - !is_nullptr_t::value && - !is_member_pointer::value && - !is_pointer::value && - !is_function::value; + static const bool value = !is_arithmetic::value && + !is_reference::value && + !is_class_or_union::value && + !is_array::value && + !is_void::value && + !is_nullptr_t::value && + !is_member_pointer::value && + !is_pointer::value && + !is_function::value; }; #endif template struct is_enum -{ static const bool value = BOOST_MOVE_IS_ENUM_IMPL(T); }; +{ + static const bool value = BOOST_MOVE_IS_ENUM_IMPL(T); +}; + + +////////////////////////// +// is_scalar +////////////////////////// +template +struct is_scalar +{ + static const bool value = is_arithmetic::value || + is_enum::value || + is_pointer::value || + is_member_pointer::value || + is_null_pointer::value; +}; + ////////////////////////////////////// // is_pod