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
@nlohmann method "value" helps to avoid outing of range only. If requested field exists, but has different type then this method throws exception. Such behavior is undesirable.
I think the solution will work for me, although im not sure whether the value function should be restricted to object types. If i provide a default value, i would not mind if the caller passed me the wrong type (something different than object).
Activity
nlohmann commentedon Nov 5, 2016
This sounds related to the
valuefunction: https://nlohmann.github.io/json/classnlohmann_1_1basic__json_a407e73a037e6e3067ef7aa2c25a79f39.html#a407e73a037e6e3067ef7aa2c25a79f39nlohmann commentedon Nov 11, 2016
@SmoofBullet Did you have the time to look at the value function?
zumm commentedon Nov 14, 2016
@nlohmann method "value" helps to avoid outing of range only. If requested field exists, but has different type then this method throws exception. Such behavior is undesirable.
nlohmann commentedon Nov 14, 2016
There has been quite a discussion about this, see #278.
zumm commentedon Nov 14, 2016
So this functional will be implemented in release 3.0.0? Great (apropos when it happens?)!
nlohmann commentedon Nov 14, 2016
#278 is planned for the 3.0.0. This release will most likely not be ready this year.
If you can live with the proposal in #278, I would like to close this ticket.
zumm commentedon Nov 15, 2016
Yes, i can. :) But could starter of this ticket?
nlohmann commentedon Nov 15, 2016
Oh, sorry. @SmoofBullet What do you think?
maleafl commentedon Nov 15, 2016
I think the solution will work for me, although im not sure whether the value function should be restricted to object types. If i provide a default value, i would not mind if the caller passed me the wrong type (something different than object).