Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 08:19:40

0001 // Copyright 2023 Matt Borland
0002 // Distributed under the Boost Software License, Version 1.0.
0003 // https://www.boost.org/LICENSE_1_0.txt
0004 
0005 #ifndef BOOST_CHARCONV_DETAIL_TYPE_TRAITS_HPP
0006 #define BOOST_CHARCONV_DETAIL_TYPE_TRAITS_HPP
0007 
0008 #include <boost/charconv/detail/config.hpp>
0009 #include <type_traits>
0010 
0011 namespace boost { namespace charconv { namespace detail {
0012 
0013 template <typename T>
0014 struct is_signed { static constexpr bool value = std::is_signed<T>::value; };
0015 
0016 #ifdef BOOST_CHARCONV_HAS_INT128
0017 
0018 template <>
0019 struct is_signed<boost::int128_type> { static constexpr bool value = true; };
0020 
0021 template <>
0022 struct is_signed<boost::uint128_type> { static constexpr bool value = false; };
0023 
0024 #endif
0025 
0026 #if defined(BOOST_NO_CXX17_INLINE_VARIABLES) && (!defined(BOOST_MSVC) || BOOST_MSVC != 1900)
0027 
0028 template <typename T>
0029 constexpr bool is_signed<T>::value;
0030 
0031 #endif
0032 
0033 template <typename T>
0034 struct make_unsigned { using type = typename std::make_unsigned<T>::type; };
0035 
0036 template <>
0037 struct make_unsigned<uint128> { using type = uint128; };
0038 
0039 #ifdef BOOST_CHARCONV_HAS_INT128
0040 
0041 template <>
0042 struct make_unsigned<boost::int128_type> { using type = boost::uint128_type; };
0043 
0044 template <>
0045 struct make_unsigned<boost::uint128_type> { using type = boost::uint128_type; };
0046 
0047 #endif
0048 
0049 template <typename T>
0050 using make_unsigned_t = typename make_unsigned<T>::type;
0051 
0052 template <typename T>
0053 struct make_signed { using type = typename std::make_signed<T>::type; };
0054 
0055 #ifdef BOOST_CHARCONV_HAS_INT128
0056 
0057 template <>
0058 struct make_signed<boost::int128_type> { using type = boost::int128_type; };
0059 
0060 template <>
0061 struct make_signed<boost::uint128_type> { using type = boost::int128_type; };
0062 
0063 #endif
0064 
0065 }}} // Namespaces
0066 
0067 #endif //BOOST_CHARCONV_DETAIL_TYPE_TRAITS_HPP