-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cant modify existing numbers inside a json object #557
Labels
kind: question
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
Comments
|
In addition to @gregmarr s remarks: To increment j["num"] = j["num"].get<int>() + 1; or
|
@AMScaglione Does this work for you? |
Yeah! Sorry, it does
…On Sat, Apr 22, 2017 at 3:57 AM, Niels Lohmann ***@***.***> wrote:
@AMScaglione <https://github.com/AMScaglione> Does this work for you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#557 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AVcekUst_5M6J6jbdQ9tFlOYcsaSz2kyks5rybL2gaJpZM4M-vei>
.
|
No problem. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kind: question
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
Say for example I have something like
I can not do something like
j["num"] += 1;
as it gives me this error on runtime:
I tried simplifying it to
j["num"] = j["num"] + 1;
but that gives me this error at compile time:
error: no match for 'operator+' (operand types are 'nlohmann::basic_json<>::value_type {aka nlohmann::basic_json<>}' and 'int')|
The text was updated successfully, but these errors were encountered: