mirror of
https://github.com/nlohmann/json.git
synced 2026-08-28 11:57:31 +00:00
@@ -544,6 +544,11 @@ for (auto& [key, value] : o.items()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// find an entry
|
// find an entry
|
||||||
|
if (o.contains("foo")) {
|
||||||
|
// there is an entry with key "foo"
|
||||||
|
}
|
||||||
|
|
||||||
|
// or via find and an iterator
|
||||||
if (o.find("foo") != o.end()) {
|
if (o.find("foo") != o.end()) {
|
||||||
// there is an entry with key "foo"
|
// there is an entry with key "foo"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user