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
I was wondering if there was a way to get the underlying value of an object without explicit typecasting. Here is what I mean:
json j = R"({"int_type": 3})"_json;
auto i_what_is_this = j["int_type"];
// to get an int, I need to explicitly typecast
auto i_int = j["int_type"].get<int>();
JSON natively supports different types, so is there a way to use that underling type to get auto i = j["int_type"]; to be of type int without explicitly typecasting?
The text was updated successfully, but these errors were encountered:
I was wondering if there was a way to get the underlying value of an object without explicit typecasting. Here is what I mean:
JSON natively supports different types, so is there a way to use that underling type to get
auto i = j["int_type"];
to be of typeint
without explicitly typecasting?The text was updated successfully, but these errors were encountered: