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
A typical operation is to find if a json object has a given key, this is typically done like:
json
json j; bool has_key = j.find("key") != j.end();
The standard containers (std::map, std::set,...) offer a count member function that counts the number of occurrences of a key, such that one can:
std::map
std::set
count
std::map<std::string, int> m; bool has_key = m.count("key"); // -> count == 0? false : true
It would be nice to have something similar since this is a very common operation.
The text was updated successfully, but these errors were encountered:
f2957dc
Merge pull request nlohmann#45 from nlohmann/develop
0d2836a
Sync Fork from Upstream Repo
nlohmann
No branches or pull requests
A typical operation is to find if a
json
object has a given key, this is typically done like:The standard containers (
std::map
,std::set
,...) offer acount
member function that counts the number of occurrences of a key, such that one can:It would be nice to have something similar since this is a very common operation.
The text was updated successfully, but these errors were encountered: