mirror of
https://github.com/nlohmann/json.git
synced 2026-07-05 10:05:10 +00:00
🧛 add trait for 128 bit integers
This commit is contained in:
@@ -353,6 +353,17 @@ struct is_compatible_integer_type_impl <
|
||||
RealLimits::is_signed == CompatibleLimits::is_signed;
|
||||
};
|
||||
|
||||
// second version for 128 bit integers that fail std::is_integral test
|
||||
template<typename RealIntegerType, typename CompatibleNumberIntegerType>
|
||||
struct is_compatible_integer_type_impl < RealIntegerType, CompatibleNumberIntegerType,
|
||||
enable_if_t < std::is_same<RealIntegerType, CompatibleNumberIntegerType>::value&&
|
||||
!std::is_integral<CompatibleNumberIntegerType>::value&&
|
||||
(std::is_unsigned<RealIntegerType>::value&& std::is_convertible<std::uint64_t, RealIntegerType>::value || !std::is_unsigned<RealIntegerType>::value&& std::is_convertible<std::int64_t, RealIntegerType>::value)&&
|
||||
!is_64_bit<RealIntegerType>::value >>
|
||||
{
|
||||
static constexpr auto value = true;
|
||||
};
|
||||
|
||||
template<typename RealIntegerType, typename CompatibleNumberIntegerType>
|
||||
struct is_compatible_integer_type
|
||||
: is_compatible_integer_type_impl<RealIntegerType,
|
||||
|
||||
Reference in New Issue
Block a user