mirror of
https://github.com/nlohmann/json.git
synced 2025-07-28 12:02:00 +03:00
Fix typos in operator[] documentation (#3102)
* Fix typos in operator[] documentation * Fix additional typo
This commit is contained in:
@ -33,7 +33,7 @@ const_reference operator[](const json_pointer& ptr) const;
|
|||||||
: index of the element to access
|
: index of the element to access
|
||||||
|
|
||||||
`key` (in)
|
`key` (in)
|
||||||
: object key of the elements to remove
|
: object key of the element to access
|
||||||
|
|
||||||
`ptr` (in)
|
`ptr` (in)
|
||||||
: JSON pointer to the desired element
|
: JSON pointer to the desired element
|
||||||
@ -48,10 +48,10 @@ const_reference operator[](const json_pointer& ptr) const;
|
|||||||
|
|
||||||
1. The function can throw the following exceptions:
|
1. The function can throw the following exceptions:
|
||||||
- Throws [`type_error.305`](../../home/exceptions.md#jsonexceptiontype_error305) if the JSON value is not an array
|
- Throws [`type_error.305`](../../home/exceptions.md#jsonexceptiontype_error305) if the JSON value is not an array
|
||||||
or null; in that cases, using the `[]` operator with an index makes no sense.
|
or null; in that case, using the `[]` operator with an index makes no sense.
|
||||||
2. The function can throw the following exceptions:
|
2. The function can throw the following exceptions:
|
||||||
- Throws [`type_error.305`](../../home/exceptions.md#jsonexceptiontype_error305) if the JSON value is not an array
|
- Throws [`type_error.305`](../../home/exceptions.md#jsonexceptiontype_error305) if the JSON value is not an object
|
||||||
or null; in that cases, using the `[]` operator with an index makes no sense.
|
or null; in that case, using the `[]` operator with a key makes no sense.
|
||||||
3. The function can throw the following exceptions:
|
3. The function can throw the following exceptions:
|
||||||
- Throws [`parse_error.106`](../../home/exceptions.md#jsonexceptionparse_error106) if an array index in the passed
|
- Throws [`parse_error.106`](../../home/exceptions.md#jsonexceptionparse_error106) if an array index in the passed
|
||||||
JSON pointer `ptr` begins with '0'.
|
JSON pointer `ptr` begins with '0'.
|
||||||
|
Reference in New Issue
Block a user