We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Can't seem to change a variable in an iterator or I don't know how to do properly. Here's what I've tried
json j; j["Callback"] = Callback; j["CallbackCalled"] = false; cout << j.dump() << endl; Updating.push_back(j); ... for (auto it = Updating.begin(); it != Updating.end(); ++it) { if (!it.value()["CallbackCalled"]) { RunCallback(it.value()["Callback"]); //(*it)["CallbackCalled"] = true; // no! //cout << (*it).dump(); // no! // auto obj = (*it).find("CallbackCalled"); // obj.value() = true; // no! // Updating["0"]["CallbackCalled"] = true; //no! //(*it).emplace("CallbackCalled", true); // no! //json j = json::parse((*it).dump()); //j["CallbackCalled"] = true; // no! }
How do I set (*it)["CallbackCalled"] = true; ?
Thanks!
The text was updated successfully, but these errors were encountered:
My bad - The callback function was doing a push_back while it was iterating, which invalidated the iterator
Sorry, something went wrong.
No branches or pull requests
Can't seem to change a variable in an iterator or I don't know how to do properly.
Here's what I've tried
How do I set (*it)["CallbackCalled"] = true; ?
Thanks!
The text was updated successfully, but these errors were encountered: