mirror of
https://github.com/nlohmann/json.git
synced 2026-10-03 05:00:30 +00:00
deploy: 4d46bce4e1
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -34,7 +34,8 @@ Logarithmic in the size of the JSON object.
|
||||
|
||||
## Notes
|
||||
|
||||
This method always returns `0` when executed on a JSON type that is not an object.
|
||||
- This method always returns `0` when executed on a JSON type that is not an object.
|
||||
- Calling this function with an integer argument (for example, `count(0)`) does not compile: such an argument would otherwise implicitly convert to a null `const char*` and, from there, cause undefined behavior when constructing a `std::string` for the object key. To check for an array element instead, use [`at`](https://json.nlohmann.me/api/basic_json/at/index.md), [`operator[]`](https://json.nlohmann.me/api/basic_json/operator%5B%5D/index.md), or compare against [`size`](https://json.nlohmann.me/api/basic_json/size/index.md).
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -113,3 +114,4 @@ number of elements with key "three": 0
|
||||
|
||||
1. Added in version 3.11.0.
|
||||
1. Added in version 1.0.0. Changed parameter `key` type to `KeyType&&` in version 3.11.0.
|
||||
1. Deleted overload for integral key types added in version 3.13.0 to reject such calls at compile time instead of causing undefined behavior at runtime.
|
||||
|
||||
Reference in New Issue
Block a user