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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Integers are currently processed in an unsafe manner:
https://godbolt.org/z/7qEM1c7eY
Proposal A:
json::get_integer<std::integral T>()Performs checks to ensure that the value is within
std::numeric_limits<T>and throws an exception before returning.Proposal B:
JSON_SAFE_INTEGER_CONVERSIONSOpt-in to make this behavior default with
json::get<std::integral T>().This doesn't address the implicit conversions from floats to integers, which it may also be desirable to restrict.
Beta Was this translation helpful? Give feedback.
All reactions