mirror of
https://github.com/nlohmann/json.git
synced 2025-07-31 10:24:23 +03:00
Extend type_name() to invalid type (#4786)
* ✅ add regression test Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 💚 fix build Signed-off-by: Niels Lohmann <mail@nlohmann.me> * 📝 add comment Signed-off-by: Niels Lohmann <mail@nlohmann.me> --------- Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@ -20648,7 +20648,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
(t == value_t::binary && binary == nullptr)
|
||||
)
|
||||
{
|
||||
//not initialized (e.g., due to exception in the ctor)
|
||||
// not initialized (e.g., due to exception in the ctor)
|
||||
return;
|
||||
}
|
||||
if (t == value_t::array || t == value_t::object)
|
||||
@ -24291,8 +24291,9 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
case value_t::number_integer:
|
||||
case value_t::number_unsigned:
|
||||
case value_t::number_float:
|
||||
default:
|
||||
return "number";
|
||||
default:
|
||||
return "invalid";
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user