mirror of
https://github.com/nlohmann/json.git
synced 2025-06-28 15:11:06 +08:00
parent
25aab7ee41
commit
27fe50dc92
@ -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"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user