You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the issue you have?
type_name() returns "number" for both value_t::number_integer, value_t::number_unsigned, value_t::number_float. This is inconsistent with type().
What is the expected behavior?
x.type_name() should return the exact string representation of the matching x.type(), as it's name implies, specifically:
value_t::number_integer: "number_integer"
value_t::number_unsigned: "number_unsigned"
value_t::number_float: "number_float"
Did you use a released version of the library or the version from the develop branch?
Develop, commit: 67259d6
The text was updated successfully, but these errors were encountered:
type_name() returns the name of the JSON type. JSON only defines a type number and does not make any differentiation between signed/unsigned or float/integer. This function is used in error messages for situations where a specific JSON type is expected, but a different one was found. In these situations, it is not helpful to state the specific type of a number - it is sufficient to have something like expected string, but got number.
type() returns an enum of the types used in the library. As you observed correctly, a JSON number can be represented by three different types internally. This function is used to define a switch to process each internal type differently, e.g. in the serialization function, where number_float needs to be treated differently than the integer types. The library does not need a textual representation of these internal types, therefore it does not offer such a function.
What is the issue you have?
type_name() returns "number" for both value_t::number_integer, value_t::number_unsigned, value_t::number_float. This is inconsistent with type().
What is the expected behavior?
x.type_name() should return the exact string representation of the matching x.type(), as it's name implies, specifically:
value_t::number_integer: "number_integer"
value_t::number_unsigned: "number_unsigned"
value_t::number_float: "number_float"
Did you use a released version of the library or the version from the
develop
branch?Develop, commit: 67259d6
The text was updated successfully, but these errors were encountered: