json class should have a get_or member function #1823
Labels
kind: enhancement/improvement
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
I found the need to write a free function
This way, I can get a value from a json object, and a default value if they key is not present. It would be great to have this as a member function of
json
, e.g.int x =
json.get_or<int>("x", 0); // 0 is default value
The text was updated successfully, but these errors were encountered: