amalgamated

This commit is contained in:
Jonas Wittbrodt 2021-08-25 13:53:28 +02:00
parent 7c1bfbe735
commit 0f0be71952
2 changed files with 36 additions and 6 deletions

View File

@ -59,13 +59,13 @@ void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
}
case value_t::null:
{
if(std::numeric_limits<ArithmeticType>::has_signaling_NaN)
if (std::numeric_limits<ArithmeticType>::has_signaling_NaN)
{
val = std::numeric_limits<ArithmeticType>::signaling_NaN();
break;
}
// LCOV_EXCL_START
else if(std::numeric_limits<ArithmeticType>::has_quiet_NaN)
else if (std::numeric_limits<ArithmeticType>::has_quiet_NaN)
{
val = std::numeric_limits<ArithmeticType>::quiet_NaN();
break;
@ -366,13 +366,13 @@ void from_json(const BasicJsonType& j, ArithmeticType& val)
}
case value_t::null:
{
if(std::numeric_limits<ArithmeticType>::has_signaling_NaN)
if (std::numeric_limits<ArithmeticType>::has_signaling_NaN)
{
val = std::numeric_limits<ArithmeticType>::signaling_NaN();
break;
}
// LCOV_EXCL_START
else if(std::numeric_limits<ArithmeticType>::has_quiet_NaN)
else if (std::numeric_limits<ArithmeticType>::has_quiet_NaN)
{
val = std::numeric_limits<ArithmeticType>::quiet_NaN();
break;

View File

@ -3920,8 +3920,23 @@ void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>());
break;
}
case value_t::null:
{
if (std::numeric_limits<ArithmeticType>::has_signaling_NaN)
{
val = std::numeric_limits<ArithmeticType>::signaling_NaN();
break;
}
// LCOV_EXCL_START
else if (std::numeric_limits<ArithmeticType>::has_quiet_NaN)
{
val = std::numeric_limits<ArithmeticType>::quiet_NaN();
break;
}
// [[fallthrough]];
// LCOV_EXCL_STOP
}
case value_t::object:
case value_t::array:
case value_t::string:
@ -4212,8 +4227,23 @@ void from_json(const BasicJsonType& j, ArithmeticType& val)
val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::boolean_t*>());
break;
}
case value_t::null:
{
if (std::numeric_limits<ArithmeticType>::has_signaling_NaN)
{
val = std::numeric_limits<ArithmeticType>::signaling_NaN();
break;
}
// LCOV_EXCL_START
else if (std::numeric_limits<ArithmeticType>::has_quiet_NaN)
{
val = std::numeric_limits<ArithmeticType>::quiet_NaN();
break;
}
// [[fallthrough]];
// LCOV_EXCL_STOP
}
case value_t::object:
case value_t::array:
case value_t::string: