/////////////////////////////////////////////////////////////// // Copyright 2012-2022 John Maddock. // Copyright 2022 Matt Borland. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt #ifndef BOOST_MP_STD_INTEGER_TRAITS_HPP #define BOOST_MP_STD_INTEGER_TRAITS_HPP #include #include namespace boost { namespace multiprecision { namespace detail { template struct is_signed : public std::is_signed {}; template struct is_unsigned : public std::is_unsigned {}; template struct is_integral : public std::is_integral {}; template struct is_arithmetic : public std::is_arithmetic {}; template struct make_unsigned : public std::make_unsigned {}; template struct make_signed : public std::make_signed {}; #ifdef BOOST_HAS_INT128 template <> struct is_signed : public std::true_type {}; template <> struct is_signed : public std::false_type {}; template <> struct is_unsigned : public std::false_type {}; template <> struct is_unsigned : public std::true_type {}; template <> struct is_integral : public std::true_type {}; template <> struct is_integral : public std::true_type {}; template <> struct is_arithmetic : public std::true_type {}; template <> struct is_arithmetic : public std::true_type {}; template <> struct make_unsigned { using type = uint128_type; }; template <> struct make_unsigned { using type = uint128_type; }; template <> struct make_signed { using type = int128_type; }; template <> struct make_signed { using type = int128_type; }; #endif // C++17-esque helpers #if defined(__cpp_variable_templates) && __cpp_variable_templates >= 201304L template BOOST_INLINE_CONSTEXPR bool is_signed_v = is_signed::value; template BOOST_INLINE_CONSTEXPR bool is_unsigned_v = is_unsigned::value; template BOOST_INLINE_CONSTEXPR bool is_integral_v = is_integral::value; template BOOST_INLINE_CONSTEXPR bool is_arithmetic_v = is_arithmetic::value; #endif template using make_unsigned_t = typename make_unsigned::type; template using make_signed_t = typename make_signed::type; }}} // namespace boost::multiprecision::detail #endif