Closed
Description
According to Niels in order to check if a number is integer it is not enough to compare the type to number_integer
as executed in fromJson()
[common.hpp
]
bool has_code = has_key_type(value, "code", json::value_t::number_integer);
This is what the json library does:
constexpr bool is_number_integer() const noexcept
{
return m_type == value_t::number_integer || m_type == value_t::number_unsigned;
}
Easiest fix is:
bool has_code = has_key_type(value, "code", json::value_t::number_integer) || has_key_type(value, "code", json::value_t::number_unsigned);
Metadata
Metadata
Assignees
Labels
No labels