mirror of
https://github.com/nlohmann/json.git
synced 2026-10-28 19:45:22 +00:00
deploy: a47170346a
This commit is contained in:
@@ -1,71 +1,19 @@
|
||||
---
|
||||
template: home.html
|
||||
hide:
|
||||
- toc
|
||||
---
|
||||
|
||||
# JSON for Modern C++
|
||||
|
||||

|
||||
|
||||
JSON for Modern C++ is a header-only C++11 library that turns JSON into a first-class C++ data type, using the operator
|
||||
magic of modern C++ so that creating, reading, and modifying JSON values feels as natural as it does in languages like
|
||||
Python. The whole library is available as a single header, `json.hpp`, with no dependencies, no subproject, and no
|
||||
complex build system to set up; a companion header, `json_fwd.hpp`, provides forward declarations to keep compile times
|
||||
down, `<nlohmann/json_literals.hpp>` holds the user-defined string literals on their own, and
|
||||
`<nlohmann/json_view.hpp>` adds zero-copy views and editable documents. See
|
||||
[header-only integration](integration/index.md) for details. It is heavily unit-tested with 100% code
|
||||
coverage, checked with Valgrind and the Clang Sanitizers for memory leaks, and continuously fuzz-tested by Google
|
||||
OSS-Fuzz.
|
||||
|
||||
## Quick start
|
||||
|
||||
Add the single header to your project and use the library like this:
|
||||
|
||||
```cpp
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using nlohmann::json;
|
||||
|
||||
int main()
|
||||
{
|
||||
// parse a JSON string
|
||||
json j = json::parse(R"({"happy": true, "pi": 3.141})");
|
||||
|
||||
// access and modify values
|
||||
j["name"] = "Niels";
|
||||
j["list"] = {1, 0, 2};
|
||||
|
||||
// read a value into a C++ variable and use it
|
||||
double pi = j["pi"].get<double>();
|
||||
std::cout << "2 * pi = " << 2 * pi << '\n';
|
||||
|
||||
// serialize with an indent of 4 spaces
|
||||
std::cout << j.dump(4) << '\n';
|
||||
}
|
||||
```
|
||||
|
||||
Get the library by copying the single header [`json.hpp`](https://github.com/nlohmann/json/releases) from the
|
||||
releases page into a directory `nlohmann` on your include path, or by installing it with a package manager:
|
||||
|
||||
```sh
|
||||
brew install nlohmann-json # Homebrew
|
||||
vcpkg install nlohmann-json # vcpkg
|
||||
```
|
||||
|
||||
```cmake
|
||||
find_package(nlohmann_json 3.12.0 REQUIRED)
|
||||
target_link_libraries(myproject PRIVATE nlohmann_json::nlohmann_json)
|
||||
```
|
||||
|
||||
See [Integration](integration/index.md) for CMake in detail, all supported package managers (Conan, Meson, Bazel,
|
||||
Conda, and more), and pkg-config.
|
||||
|
||||
## Explore the documentation
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- :octicons-rocket-24:{ .lg .middle } __Features__
|
||||
|
||||
---
|
||||
|
||||
Creating, parsing, accessing, and serializing JSON values, JSON Pointer/Patch, binary formats, zero-copy views,
|
||||
and more.
|
||||
Creating, parsing, accessing, and serializing JSON values, converting your own C++ types, JSON Pointer/Patch/Merge
|
||||
Patch, binary formats, zero-copy views, and more.
|
||||
|
||||
[:octicons-arrow-right-24: Features](features/index.md)
|
||||
|
||||
@@ -112,11 +60,5 @@ Conda, and more), and pkg-config.
|
||||
|
||||
</div>
|
||||
|
||||
!!! info "Unreleased changes"
|
||||
|
||||
This documentation is built from the `develop` branch and may describe changes that are not part of a release
|
||||
yet. Their version numbers are followed by an <span class="unreleased-version">unreleased</span> badge; see
|
||||
[Releases](home/releases/index.md) for what shipped in each version.
|
||||
|
||||
The library is licensed under the [MIT License](home/license.md). The source code, issue tracker, and discussions
|
||||
are on [GitHub](https://github.com/nlohmann/json).
|
||||

|
||||

|
||||
|
||||
@@ -33,10 +33,10 @@ struct adl_serializer {
|
||||
## See also
|
||||
|
||||
- [Arbitrary type conversions](../../features/arbitrary_types.md) - how to make your types convertible
|
||||
- [**get**](../basic_json/get.md) / [**get_to**](../basic_json/get_to.md) - convert a JSON value to a C++ type
|
||||
- [**basic_json**](../basic_json/basic_json.md) - construct a JSON value from a C++ value
|
||||
- [**NLOHMANN_DEFINE_TYPE_INTRUSIVE**](../macros/nlohmann_define_type_intrusive.md) - generate the conversion functions for a type
|
||||
- [Specializing enum conversion](../../features/enum_conversion.md)
|
||||
- [`get`](../basic_json/get.md) - / [`get_to`](../basic_json/get_to.md) - convert a JSON value to a C++ type
|
||||
- [`basic_json`](../basic_json/basic_json.md) - construct a JSON value from a C++ value
|
||||
- [`NLOHMANN_DEFINE_TYPE_INTRUSIVE`](../macros/nlohmann_define_type_intrusive.md) - generate the conversion functions for a type
|
||||
- [Specializing enum conversion](../../features/enum_conversion.md) - serializing enums as JSON strings
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class (either explicitly or via the conversion operators).
|
||||
|
||||
## Return value
|
||||
|
||||
1. (none) -- the converted value is written to the output parameter `val`.
|
||||
1. (none) — the converted value is written to the output parameter `val`.
|
||||
2. the JSON value `j` converted to `TargetType`
|
||||
|
||||
## Examples
|
||||
@@ -159,7 +159,9 @@ class (either explicitly or via the conversion operators).
|
||||
|
||||
## See also
|
||||
|
||||
- [to_json](to_json.md)
|
||||
- [`to_json`](to_json.md) - convert a C++ value to JSON
|
||||
- [Arbitrary Type Conversions](../../features/arbitrary_types.md) - write your own `from_json` and `to_json` functions
|
||||
- [Converting values](../../features/conversions.md) - overview of `get`, `get_to` and implicit conversions
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -27,7 +27,7 @@ This function is usually called by the [`get()`](https://json.nlohmann.me/api/ba
|
||||
|
||||
## Return value
|
||||
|
||||
1. (none) -- the converted value is written to the output parameter `val`.
|
||||
1. (none) — the converted value is written to the output parameter `val`.
|
||||
1. the JSON value `j` converted to `TargetType`
|
||||
|
||||
## Examples
|
||||
@@ -150,7 +150,9 @@ Ned Flanders (60) lives in 744 Evergreen Terrace
|
||||
|
||||
## See also
|
||||
|
||||
- [to_json](https://json.nlohmann.me/api/adl_serializer/to_json/index.md)
|
||||
- [`to_json`](https://json.nlohmann.me/api/adl_serializer/to_json/index.md) - convert a C++ value to JSON
|
||||
- [Arbitrary Type Conversions](https://json.nlohmann.me/features/arbitrary_types/index.md) - write your own `from_json` and `to_json` functions
|
||||
- [Converting values](https://json.nlohmann.me/features/conversions/index.md) - overview of `get`, `get_to` and implicit conversions
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -32,10 +32,10 @@ struct adl_serializer {
|
||||
## See also
|
||||
|
||||
- [Arbitrary type conversions](https://json.nlohmann.me/features/arbitrary_types/index.md) - how to make your types convertible
|
||||
- [**get**](https://json.nlohmann.me/api/basic_json/get/index.md) / [**get_to**](https://json.nlohmann.me/api/basic_json/get_to/index.md) - convert a JSON value to a C++ type
|
||||
- [**basic_json**](https://json.nlohmann.me/api/basic_json/basic_json/index.md) - construct a JSON value from a C++ value
|
||||
- [**NLOHMANN_DEFINE_TYPE_INTRUSIVE**](https://json.nlohmann.me/api/macros/nlohmann_define_type_intrusive/index.md) - generate the conversion functions for a type
|
||||
- [Specializing enum conversion](https://json.nlohmann.me/features/enum_conversion/index.md)
|
||||
- [`get`](https://json.nlohmann.me/api/basic_json/get/index.md) - / [`get_to`](https://json.nlohmann.me/api/basic_json/get_to/index.md) - convert a JSON value to a C++ type
|
||||
- [`basic_json`](https://json.nlohmann.me/api/basic_json/basic_json/index.md) - construct a JSON value from a C++ value
|
||||
- [`NLOHMANN_DEFINE_TYPE_INTRUSIVE`](https://json.nlohmann.me/api/macros/nlohmann_define_type_intrusive/index.md) - generate the conversion functions for a type
|
||||
- [Specializing enum conversion](https://json.nlohmann.me/features/enum_conversion/index.md) - serializing enums as JSON strings
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -69,7 +69,9 @@ This function is usually called by the constructors of the [basic_json](../basic
|
||||
|
||||
## See also
|
||||
|
||||
- [from_json](from_json.md)
|
||||
- [`from_json`](from_json.md) - convert JSON to a C++ value
|
||||
- [Arbitrary Type Conversions](../../features/arbitrary_types.md) - write your own `from_json` and `to_json` functions
|
||||
- [Converting values](../../features/conversions.md) - overview of `get`, `get_to` and implicit conversions
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -64,7 +64,9 @@ Output:
|
||||
|
||||
## See also
|
||||
|
||||
- [from_json](https://json.nlohmann.me/api/adl_serializer/from_json/index.md)
|
||||
- [`from_json`](https://json.nlohmann.me/api/adl_serializer/from_json/index.md) - convert JSON to a C++ value
|
||||
- [Arbitrary Type Conversions](https://json.nlohmann.me/features/arbitrary_types/index.md) - write your own `from_json` and `to_json` functions
|
||||
- [Converting values](https://json.nlohmann.me/features/conversions/index.md) - overview of `get`, `get_to` and implicit conversions
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
+9
-4
@@ -189,7 +189,7 @@ The class satisfies the following concept requirements:
|
||||
Functions to inspect the type of a JSON value.
|
||||
|
||||
- [**type**](type.md) - return the type of the JSON value
|
||||
- [**operator value_t**](operator_value_t.md) - return the type of the JSON value
|
||||
- [`operator value_t`](operator_value_t.md) - return the type of the JSON value
|
||||
- [**type_name**](type_name.md) - return the type as string
|
||||
- [**is_primitive**](is_primitive.md) - return whether the type is primitive
|
||||
- [**is_structured**](is_structured.md) - return whether the type is structured
|
||||
@@ -218,7 +218,7 @@ Direct access to the stored value of a JSON value.
|
||||
- [**get_to**](get_to.md) - get a value and write it to a destination
|
||||
- [**get_ptr**](get_ptr.md) - get a pointer value
|
||||
- [**get_ref**](get_ref.md) - get a reference value
|
||||
- [**operator ValueType**](operator_ValueType.md) - get a value
|
||||
- [`operator ValueType`](operator_ValueType.md) - get a value
|
||||
- [**get_binary**](get_binary.md) - get a binary value
|
||||
- [**as_base_class**](as_base_class.md) - access the custom base class
|
||||
|
||||
@@ -425,10 +425,15 @@ Access to the JSON value
|
||||
|
||||
## See also
|
||||
|
||||
- [RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format](https://tools.ietf.org/html/rfc8259)
|
||||
- [basic_json_document](../basic_json_document/index.md) / [basic_json_view](../basic_json_view/index.md) - parse a JSON
|
||||
- [RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format](https://tools.ietf.org/html/rfc8259) -
|
||||
specification of the JSON data interchange format
|
||||
- [`basic_json_document`](../basic_json_document/index.md) - / [`basic_json_view`](../basic_json_view/index.md) - parse a JSON
|
||||
text into a flat index and read it through a view
|
||||
- [Zero-copy JSON views](../../features/json_view.md) - when to use a document and a view instead of a `basic_json`
|
||||
- [Types](../../features/types/index.md) - how JSON values are stored and which types exist
|
||||
- [Converting values](../../features/conversions.md) - get values out of a JSON value and put values in
|
||||
- [Creating JSON values](../../features/creating_values.md) - all the ways to build a JSON value
|
||||
- [Arbitrary Type Conversions](../../features/arbitrary_types.md) - convert your own types to and from JSON
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -210,15 +210,20 @@ outside of a string, invalid) byte; see the [FAQ entry](../../home/faq.md#nul-by
|
||||
|
||||
## See also
|
||||
|
||||
- [parse](parse.md) - deserialize from a compatible input
|
||||
- [sax_parse](sax_parse.md) - parse input using the SAX interface
|
||||
- [operator>>](../operator_gtgt.md) - deserialize from stream
|
||||
- [`parse`](parse.md) - deserialize from a compatible input
|
||||
- [`sax_parse`](sax_parse.md) - parse input using the SAX interface
|
||||
- [`operator>>`](../operator_gtgt.md) - deserialize from stream
|
||||
- [`JSON_STRICT_NUL_HANDLING`](../macros/json_strict_nul_handling.md) - opt in to rejecting a NUL byte in the input
|
||||
instead of treating it as end of input
|
||||
- [`JSON_DISABLE_STREAM_BULK_SCAN`](../macros/json_disable_stream_bulk_scan.md) - read a `std::istream` one character
|
||||
at a time
|
||||
- [`JSON_DISABLE_UNLOCKED_FILE_IO`](../macros/json_disable_unlocked_file_io.md) - read a `FILE*` with the locking stdio
|
||||
functions
|
||||
- [Parsing](../../features/parsing/index.md) - overview of the parsing functions
|
||||
- [Comments](../../features/comments.md) - ignore `//` and `/* */` comments while parsing
|
||||
- [Trailing Commas](../../features/trailing_commas.md) - accept trailing commas in arrays and objects
|
||||
- [Parsing and Exceptions](../../features/parsing/parse_exceptions.md) - handling parse errors and locating them in the input
|
||||
- [Parsing Untrusted Input](../../features/parsing/untrusted_input.md) - limits and checks for input you do not control
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -193,12 +193,17 @@ true false
|
||||
|
||||
## See also
|
||||
|
||||
- [parse](https://json.nlohmann.me/api/basic_json/parse/index.md) - deserialize from a compatible input
|
||||
- [sax_parse](https://json.nlohmann.me/api/basic_json/sax_parse/index.md) - parse input using the SAX interface
|
||||
- [operator>>](https://json.nlohmann.me/api/operator_gtgt/index.md) - deserialize from stream
|
||||
- [`parse`](https://json.nlohmann.me/api/basic_json/parse/index.md) - deserialize from a compatible input
|
||||
- [`sax_parse`](https://json.nlohmann.me/api/basic_json/sax_parse/index.md) - parse input using the SAX interface
|
||||
- [`operator>>`](https://json.nlohmann.me/api/operator_gtgt/index.md) - deserialize from stream
|
||||
- [`JSON_STRICT_NUL_HANDLING`](https://json.nlohmann.me/api/macros/json_strict_nul_handling/index.md) - opt in to rejecting a NUL byte in the input instead of treating it as end of input
|
||||
- [`JSON_DISABLE_STREAM_BULK_SCAN`](https://json.nlohmann.me/api/macros/json_disable_stream_bulk_scan/index.md) - read a `std::istream` one character at a time
|
||||
- [`JSON_DISABLE_UNLOCKED_FILE_IO`](https://json.nlohmann.me/api/macros/json_disable_unlocked_file_io/index.md) - read a `FILE*` with the locking stdio functions
|
||||
- [Parsing](https://json.nlohmann.me/features/parsing/index.md) - overview of the parsing functions
|
||||
- [Comments](https://json.nlohmann.me/features/comments/index.md) - ignore `//` and `/* */` comments while parsing
|
||||
- [Trailing Commas](https://json.nlohmann.me/features/trailing_commas/index.md) - accept trailing commas in arrays and objects
|
||||
- [Parsing and Exceptions](https://json.nlohmann.me/features/parsing/parse_exceptions/index.md) - handling parse errors and locating them in the input
|
||||
- [Parsing Untrusted Input](https://json.nlohmann.me/features/parsing/untrusted_input/index.md) - limits and checks for input you do not control
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -29,9 +29,9 @@ Linear in the size of `init`.
|
||||
This function is only needed to express two edge cases that cannot be realized with the initializer list constructor
|
||||
([`basic_json(initializer_list_t, bool, value_t)`](basic_json.md)). These cases are:
|
||||
|
||||
1. creating an array whose elements are all pairs whose first element is a string -- in this case, the initializer list
|
||||
1. creating an array whose elements are all pairs whose first element is a string — in this case, the initializer list
|
||||
constructor would create an object, taking the first elements as keys
|
||||
2. creating an empty array -- passing the empty initializer list to the initializer list constructor yields an empty
|
||||
2. creating an empty array — passing the empty initializer list to the initializer list constructor yields an empty
|
||||
object
|
||||
|
||||
## Examples
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -26,8 +26,8 @@ Linear in the size of `init`.
|
||||
|
||||
This function is only needed to express two edge cases that cannot be realized with the initializer list constructor ([`basic_json(initializer_list_t, bool, value_t)`](https://json.nlohmann.me/api/basic_json/basic_json/index.md)). These cases are:
|
||||
|
||||
1. creating an array whose elements are all pairs whose first element is a string -- in this case, the initializer list constructor would create an object, taking the first elements as keys
|
||||
1. creating an empty array -- passing the empty initializer list to the initializer list constructor yields an empty object
|
||||
1. creating an array whose elements are all pairs whose first element is a string — in this case, the initializer list constructor would create an object, taking the first elements as keys
|
||||
1. creating an empty array — passing the empty initializer list to the initializer list constructor yields an empty object
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
@@ -80,10 +80,12 @@ Arrays are stored as pointers in a `basic_json` type. That is, for any access to
|
||||
|
||||
## See also
|
||||
|
||||
- [object_t](object_t.md) the type used to store JSON objects
|
||||
- [binary_t](binary_t.md) the type used to store binary values
|
||||
- [is_array](is_array.md) checks whether the JSON value is an array
|
||||
- [max_size](max_size.md) returns the maximum possible number of elements
|
||||
- [`object_t`](object_t.md) - the type used to store JSON objects
|
||||
- [`binary_t`](binary_t.md) - the type used to store binary values
|
||||
- [`is_array`](is_array.md) - checks whether the JSON value is an array
|
||||
- [`max_size`](max_size.md) - returns the maximum possible number of elements
|
||||
- [Types](../../features/types/index.md) - how arrays are stored
|
||||
- [Template Parameter Requirements](../../features/types/template_parameters.md) - requirements on the `ArrayType` template parameter
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -70,10 +70,12 @@ true
|
||||
|
||||
## See also
|
||||
|
||||
- [object_t](https://json.nlohmann.me/api/basic_json/object_t/index.md) the type used to store JSON objects
|
||||
- [binary_t](https://json.nlohmann.me/api/basic_json/binary_t/index.md) the type used to store binary values
|
||||
- [is_array](https://json.nlohmann.me/api/basic_json/is_array/index.md) checks whether the JSON value is an array
|
||||
- [max_size](https://json.nlohmann.me/api/basic_json/max_size/index.md) returns the maximum possible number of elements
|
||||
- [`object_t`](https://json.nlohmann.me/api/basic_json/object_t/index.md) - the type used to store JSON objects
|
||||
- [`binary_t`](https://json.nlohmann.me/api/basic_json/binary_t/index.md) - the type used to store binary values
|
||||
- [`is_array`](https://json.nlohmann.me/api/basic_json/is_array/index.md) - checks whether the JSON value is an array
|
||||
- [`max_size`](https://json.nlohmann.me/api/basic_json/max_size/index.md) - returns the maximum possible number of elements
|
||||
- [Types](https://json.nlohmann.me/features/types/index.md) - how arrays are stored
|
||||
- [Template Parameter Requirements](https://json.nlohmann.me/features/types/template_parameters/index.md) - requirements on the `ArrayType` template parameter
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -77,7 +77,8 @@ The function is equivalent to `static_cast<json_base_class_t&>(j)` (or `static_c
|
||||
|
||||
## See also
|
||||
|
||||
- [json_base_class_t](json_base_class_t.md) - type of the custom base class
|
||||
- [`json_base_class_t`](json_base_class_t.md) - type of the custom base class
|
||||
- [Template Parameter Requirements](../../features/types/template_parameters.md) - requirements on the `CustomBaseClass` template parameter
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -72,7 +72,8 @@ my_type_name 42
|
||||
|
||||
## See also
|
||||
|
||||
- [json_base_class_t](https://json.nlohmann.me/api/basic_json/json_base_class_t/index.md) - type of the custom base class
|
||||
- [`json_base_class_t`](https://json.nlohmann.me/api/basic_json/json_base_class_t/index.md) - type of the custom base class
|
||||
- [Template Parameter Requirements](https://json.nlohmann.me/features/types/template_parameters/index.md) - requirements on the `CustomBaseClass` template parameter
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -713,10 +713,12 @@ Strong exception safety: if an exception occurs, the original value stays intact
|
||||
|
||||
## See also
|
||||
|
||||
- documentation on [checked access](../../features/element_access/checked_access.md)
|
||||
- [`operator[]`](operator%5B%5D.md) for unchecked access by reference
|
||||
- [`value`](value.md) for access with default value
|
||||
- [basic_json_view::at](../basic_json_view/at.md) - the same access on a zero-copy view
|
||||
- [Checked access](../../features/element_access/checked_access.md) - element access with range checking
|
||||
- [`operator[]`](operator%5B%5D.md) - unchecked access by reference
|
||||
- [`value`](value.md) - access with default value
|
||||
- [`basic_json_view::at`](../basic_json_view/at.md) - the same access on a zero-copy view
|
||||
- [Element Access](../../features/element_access/index.md) - overview of all ways to access elements
|
||||
- [JSON Pointer](../../features/json_pointer.md) - access nested values with a pointer
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -666,10 +666,12 @@ Output:
|
||||
|
||||
## See also
|
||||
|
||||
- documentation on [checked access](https://json.nlohmann.me/features/element_access/checked_access/index.md)
|
||||
- [`operator[]`](https://json.nlohmann.me/api/basic_json/operator%5B%5D/index.md) for unchecked access by reference
|
||||
- [`value`](https://json.nlohmann.me/api/basic_json/value/index.md) for access with default value
|
||||
- [basic_json_view::at](https://json.nlohmann.me/api/basic_json_view/at/index.md) - the same access on a zero-copy view
|
||||
- [Checked access](https://json.nlohmann.me/features/element_access/checked_access/index.md) - element access with range checking
|
||||
- [`operator[]`](https://json.nlohmann.me/api/basic_json/operator%5B%5D/index.md) - unchecked access by reference
|
||||
- [`value`](https://json.nlohmann.me/api/basic_json/value/index.md) - access with default value
|
||||
- [`basic_json_view::at`](https://json.nlohmann.me/api/basic_json_view/at/index.md) - the same access on a zero-copy view
|
||||
- [Element Access](https://json.nlohmann.me/features/element_access/index.md) - overview of all ways to access elements
|
||||
- [JSON Pointer](https://json.nlohmann.me/features/json_pointer/index.md) - access nested values with a pointer
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -102,8 +102,9 @@ Constant.
|
||||
|
||||
## See also
|
||||
|
||||
- [front](front.md) to access the first element
|
||||
- [basic_json_view::back](../basic_json_view/back.md) - the same access on a zero-copy view
|
||||
- [`front`](front.md) - to access the first element
|
||||
- [`basic_json_view::back`](../basic_json_view/back.md) - the same access on a zero-copy view
|
||||
- [Element Access](../../features/element_access/index.md) - overview of all ways to access elements
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -97,8 +97,9 @@ true
|
||||
|
||||
## See also
|
||||
|
||||
- [front](https://json.nlohmann.me/api/basic_json/front/index.md) to access the first element
|
||||
- [basic_json_view::back](https://json.nlohmann.me/api/basic_json_view/back/index.md) - the same access on a zero-copy view
|
||||
- [`front`](https://json.nlohmann.me/api/basic_json/front/index.md) - to access the first element
|
||||
- [`basic_json_view::back`](https://json.nlohmann.me/api/basic_json_view/back/index.md) - the same access on a zero-copy view
|
||||
- [Element Access](https://json.nlohmann.me/features/element_access/index.md) - overview of all ways to access elements
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ basic_json(basic_json&& other) noexcept;
|
||||
The postcondition of this constructor can be restored by calling [`clear()`](clear.md).
|
||||
|
||||
2. Create a `#!json null` JSON value. It either takes a null pointer as parameter (explicitly creating `#!json null`)
|
||||
or no parameter (implicitly creating `#!json null`). The passed null pointer itself is not read -- it is only used to
|
||||
or no parameter (implicitly creating `#!json null`). The passed null pointer itself is not read — it is only used to
|
||||
choose the right constructor.
|
||||
|
||||
3. This is a "catch all" constructor for all compatible JSON types; that is, types for which a `to_json()` method
|
||||
@@ -113,19 +113,22 @@ basic_json(basic_json&& other) noexcept;
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A(["initializer_list init"]) --> B{"empty, or every element is a 2-element<br/>array whose first element is a string?"}
|
||||
B -->|"yes"| C{"type_deduction"}
|
||||
B -->|"no"| D{"type_deduction"}
|
||||
A(["initializer_list init"]) --> B{{"empty, or every element is a 2-element<br/>array whose first element is a string?"}}
|
||||
B -->|"yes"| C{{"type_deduction"}}
|
||||
B -->|"no"| D{{"type_deduction"}}
|
||||
C -->|"true"| OBJ["create object"]
|
||||
C -->|"false"| E{"manual_type"}
|
||||
C -->|"false"| E{{"manual_type"}}
|
||||
E -->|"object"| OBJ
|
||||
E -->|"array"| ARR["create array"]
|
||||
D -->|"true"| ARR
|
||||
D -->|"false"| F{"manual_type"}
|
||||
D -->|"false"| F{{"manual_type"}}
|
||||
F -->|"array"| ARR
|
||||
F -->|"object"| ERR["throw type_error.301"]
|
||||
```
|
||||
|
||||
<p class="nj-caption" markdown>Decision flow for an initializer list: hexagons are checks, edge labels are their
|
||||
outcomes, and rectangles are the resulting value or exception.</p>
|
||||
|
||||
The rules aim to create the best fit between a C++ initializer list and JSON values. The rationale is as follows:
|
||||
|
||||
1. The empty initializer list is written as `#!cpp {}` which is exactly an empty JSON object.
|
||||
@@ -922,12 +925,13 @@ basic_json(basic_json&& other) noexcept;
|
||||
|
||||
## See also
|
||||
|
||||
- [array](array.md) create a JSON array value, forcing array creation from an initializer list even when it looks like
|
||||
- [`array`](array.md) - create a JSON array value, forcing array creation from an initializer list even when it looks like
|
||||
an object
|
||||
- [object](object.md) create a JSON object value, forcing object creation from an initializer list
|
||||
- [binary](binary.md) create a JSON binary array value
|
||||
- [operator=](operator=.md) copy assignment operator
|
||||
- [`object`](object.md) - create a JSON object value, forcing object creation from an initializer list
|
||||
- [`binary`](binary.md) - create a JSON binary array value
|
||||
- [`operator=`](operator=.md) - copy assignment operator
|
||||
- [Creating JSON values](../../features/creating_values.md) - the article on creating JSON values
|
||||
- [Converting values](../../features/conversions.md) - which C++ types can be converted
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -50,7 +50,7 @@ basic_json(basic_json&& other) noexcept;
|
||||
|
||||
The postcondition of this constructor can be restored by calling [`clear()`](https://json.nlohmann.me/api/basic_json/clear/index.md).
|
||||
|
||||
1. Create a `null` JSON value. It either takes a null pointer as parameter (explicitly creating `null`) or no parameter (implicitly creating `null`). The passed null pointer itself is not read -- it is only used to choose the right constructor.
|
||||
1. Create a `null` JSON value. It either takes a null pointer as parameter (explicitly creating `null`) or no parameter (implicitly creating `null`). The passed null pointer itself is not read — it is only used to choose the right constructor.
|
||||
|
||||
1. This is a "catch all" constructor for all compatible JSON types; that is, types for which a `to_json()` method exists. The constructor forwards the parameter `val` to that method (to `json_serializer<U>::to_json` method with `U = uncvref_t<CompatibleType>`, to be exact).
|
||||
|
||||
@@ -84,19 +84,21 @@ basic_json(basic_json&& other) noexcept;
|
||||
|
||||
```
|
||||
flowchart TD
|
||||
A(["initializer_list init"]) --> B{"empty, or every element is a 2-element<br/>array whose first element is a string?"}
|
||||
B -->|"yes"| C{"type_deduction"}
|
||||
B -->|"no"| D{"type_deduction"}
|
||||
A(["initializer_list init"]) --> B{{"empty, or every element is a 2-element<br/>array whose first element is a string?"}}
|
||||
B -->|"yes"| C{{"type_deduction"}}
|
||||
B -->|"no"| D{{"type_deduction"}}
|
||||
C -->|"true"| OBJ["create object"]
|
||||
C -->|"false"| E{"manual_type"}
|
||||
C -->|"false"| E{{"manual_type"}}
|
||||
E -->|"object"| OBJ
|
||||
E -->|"array"| ARR["create array"]
|
||||
D -->|"true"| ARR
|
||||
D -->|"false"| F{"manual_type"}
|
||||
D -->|"false"| F{{"manual_type"}}
|
||||
F -->|"array"| ARR
|
||||
F -->|"object"| ERR["throw type_error.301"]
|
||||
```
|
||||
|
||||
Decision flow for an initializer list: hexagons are checks, edge labels are their outcomes, and rectangles are the resulting value or exception.
|
||||
|
||||
The rules aim to create the best fit between a C++ initializer list and JSON values. The rationale is as follows:
|
||||
|
||||
1. The empty initializer list is written as `{}` which is exactly an empty JSON object.
|
||||
@@ -824,11 +826,12 @@ null
|
||||
|
||||
## See also
|
||||
|
||||
- [array](https://json.nlohmann.me/api/basic_json/array/index.md) create a JSON array value, forcing array creation from an initializer list even when it looks like an object
|
||||
- [object](https://json.nlohmann.me/api/basic_json/object/index.md) create a JSON object value, forcing object creation from an initializer list
|
||||
- [binary](https://json.nlohmann.me/api/basic_json/binary/index.md) create a JSON binary array value
|
||||
- [operator=](https://json.nlohmann.me/api/basic_json/operator%3D/index.md) copy assignment operator
|
||||
- [`array`](https://json.nlohmann.me/api/basic_json/array/index.md) - create a JSON array value, forcing array creation from an initializer list even when it looks like an object
|
||||
- [`object`](https://json.nlohmann.me/api/basic_json/object/index.md) - create a JSON object value, forcing object creation from an initializer list
|
||||
- [`binary`](https://json.nlohmann.me/api/basic_json/binary/index.md) - create a JSON binary array value
|
||||
- [`operator=`](https://json.nlohmann.me/api/basic_json/operator%3D/index.md) - copy assignment operator
|
||||
- [Creating JSON values](https://json.nlohmann.me/features/creating_values/index.md) - the article on creating JSON values
|
||||
- [Converting values](https://json.nlohmann.me/features/conversions/index.md) - which C++ types can be converted
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
+39
-6
@@ -7,7 +7,40 @@ const_iterator begin() const noexcept;
|
||||
|
||||
Returns an iterator to the first element.
|
||||
|
||||

|
||||
<div class="nj-fig-wrap" markdown>
|
||||
<svg class="nj-fig nj-fig--range" viewBox="0 0 600 150" role="img" aria-labelledby="fig-be-title" xmlns="http://www.w3.org/2000/svg">
|
||||
<title id="fig-be-title">A row of fifteen elements followed by a dashed past-the-last position. begin() points to the first element and end() points to the past-the-last position.</title>
|
||||
<defs><marker id="fig-be-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path class="fg-head" d="M0 1 L10 5 L0 9 z"/></marker></defs>
|
||||
<rect class="fg-cell" x="30" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="64" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="98" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="132" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="166" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="200" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="234" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="268" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="302" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="336" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="370" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="404" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="438" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="472" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="506" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell fg-cell--end" x="540" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-pill" x="15" y="8" width="60" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="45" y="24">begin</text>
|
||||
<line class="fg-arrow" x1="45" y1="32" x2="45" y2="60" marker-end="url(#fig-be-arrow)"/>
|
||||
<rect class="fg-pill" x="531" y="8" width="48" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="555" y="24">end</text>
|
||||
<line class="fg-arrow" x1="555" y1="32" x2="555" y2="60" marker-end="url(#fig-be-arrow)"/>
|
||||
<text class="fg-note fg-note--r" x="537" y="132">Past-the-last element</text>
|
||||
<line class="fg-arrow" x1="555" y1="124" x2="555" y2="96" marker-end="url(#fig-be-arrow)"/>
|
||||
</svg>
|
||||
|
||||
</div>
|
||||
|
||||
<p class="nj-caption" markdown>`begin()` points to the first element and `end()` to the position after the last element;
|
||||
the dashed cell is the past-the-last position, which must not be dereferenced.</p>
|
||||
|
||||
## Return value
|
||||
|
||||
@@ -56,12 +89,12 @@ Constant.
|
||||
|
||||
## See also
|
||||
|
||||
- [end](end.md) returns an iterator to one past the last element
|
||||
- [cbegin](cbegin.md) returns a const iterator to the first element
|
||||
- [rbegin](rbegin.md) returns a reverse iterator to the last element
|
||||
- [items](items.md) returns an iteration proxy to access keys and values during range-based for loops
|
||||
- [`end`](end.md) - returns an iterator to one past the last element
|
||||
- [`cbegin`](cbegin.md) - returns a const iterator to the first element
|
||||
- [`rbegin`](rbegin.md) - returns a reverse iterator to the last element
|
||||
- [`items`](items.md) - returns an iteration proxy to access keys and values during range-based for loops
|
||||
- [Iterators](../../features/iterators.md) - the article on iterators
|
||||
- [basic_json_view::begin](../basic_json_view/begin.md) - the same iteration on a zero-copy view (in document order,
|
||||
- [`basic_json_view::begin`](../basic_json_view/begin.md) - the same iteration on a zero-copy view (in document order,
|
||||
not sorted by key)
|
||||
|
||||
## Version history
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -7,6 +7,8 @@ const_iterator begin() const noexcept;
|
||||
|
||||
Returns an iterator to the first element.
|
||||
|
||||
`begin()` points to the first element and `end()` to the position after the last element; the dashed cell is the past-the-last position, which must not be dereferenced.
|
||||
|
||||
## Return value
|
||||
|
||||
iterator to the first element
|
||||
@@ -52,12 +54,12 @@ Output:
|
||||
|
||||
## See also
|
||||
|
||||
- [end](https://json.nlohmann.me/api/basic_json/end/index.md) returns an iterator to one past the last element
|
||||
- [cbegin](https://json.nlohmann.me/api/basic_json/cbegin/index.md) returns a const iterator to the first element
|
||||
- [rbegin](https://json.nlohmann.me/api/basic_json/rbegin/index.md) returns a reverse iterator to the last element
|
||||
- [items](https://json.nlohmann.me/api/basic_json/items/index.md) returns an iteration proxy to access keys and values during range-based for loops
|
||||
- [`end`](https://json.nlohmann.me/api/basic_json/end/index.md) - returns an iterator to one past the last element
|
||||
- [`cbegin`](https://json.nlohmann.me/api/basic_json/cbegin/index.md) - returns a const iterator to the first element
|
||||
- [`rbegin`](https://json.nlohmann.me/api/basic_json/rbegin/index.md) - returns a reverse iterator to the last element
|
||||
- [`items`](https://json.nlohmann.me/api/basic_json/items/index.md) - returns an iteration proxy to access keys and values during range-based for loops
|
||||
- [Iterators](https://json.nlohmann.me/features/iterators/index.md) - the article on iterators
|
||||
- [basic_json_view::begin](https://json.nlohmann.me/api/basic_json_view/begin/index.md) - the same iteration on a zero-copy view (in document order, not sorted by key)
|
||||
- [`basic_json_view::begin`](https://json.nlohmann.me/api/basic_json_view/begin/index.md) - the same iteration on a zero-copy view (in document order, not sorted by key)
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -80,10 +80,11 @@ initialization of a binary array type, for backwards compatibility and so it doe
|
||||
|
||||
## See also
|
||||
|
||||
- [binary_t](binary_t.md) type for binary values
|
||||
- [get_binary](get_binary.md) get a reference to the stored binary value
|
||||
- [is_binary](is_binary.md) return whether the value is binary
|
||||
- [byte_container_with_subtype](../byte_container_with_subtype/index.md) container for binary values with subtype
|
||||
- [Binary formats](../../features/binary_formats/index.md) - formats that can store binary values
|
||||
- [`binary_t`](binary_t.md) - type for binary values
|
||||
- [`get_binary`](get_binary.md) - get a reference to the stored binary value
|
||||
- [`is_binary`](is_binary.md) - return whether the value is binary
|
||||
- [`byte_container_with_subtype`](../byte_container_with_subtype/index.md) - container for binary values with subtype
|
||||
- [Binary Values](../../features/binary_values.md) - the article on binary values
|
||||
|
||||
## Version history
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -72,10 +72,11 @@ type: binary, subtype: 42
|
||||
|
||||
## See also
|
||||
|
||||
- [binary_t](https://json.nlohmann.me/api/basic_json/binary_t/index.md) type for binary values
|
||||
- [get_binary](https://json.nlohmann.me/api/basic_json/get_binary/index.md) get a reference to the stored binary value
|
||||
- [is_binary](https://json.nlohmann.me/api/basic_json/is_binary/index.md) return whether the value is binary
|
||||
- [byte_container_with_subtype](https://json.nlohmann.me/api/byte_container_with_subtype/index.md) container for binary values with subtype
|
||||
- [Binary formats](https://json.nlohmann.me/features/binary_formats/index.md) - formats that can store binary values
|
||||
- [`binary_t`](https://json.nlohmann.me/api/basic_json/binary_t/index.md) - type for binary values
|
||||
- [`get_binary`](https://json.nlohmann.me/api/basic_json/get_binary/index.md) - get a reference to the stored binary value
|
||||
- [`is_binary`](https://json.nlohmann.me/api/basic_json/is_binary/index.md) - return whether the value is binary
|
||||
- [`byte_container_with_subtype`](https://json.nlohmann.me/api/byte_container_with_subtype/index.md) - container for binary values with subtype
|
||||
- [Binary Values](https://json.nlohmann.me/features/binary_values/index.md) - the article on binary values
|
||||
|
||||
## Version history
|
||||
|
||||
@@ -41,7 +41,7 @@ represent a byte array in modern C++.
|
||||
[`byte_container_with_subtype`](../byte_container_with_subtype/index.md) derives directly from it. Its
|
||||
`value_type` must additionally be exactly one byte wide (e.g., `std::uint8_t`/`char`/`std::byte`): the binary
|
||||
serializers (CBOR, MessagePack, BSON, UBJSON) read and write the container's raw bytes via
|
||||
`reinterpret_cast`, which is only correct for byte-sized elements -- a container like
|
||||
`reinterpret_cast`, which is only correct for byte-sized elements — a container like
|
||||
`#!cpp std::vector<std::intptr_t>` will not work as `BinaryType`. The elements must be stored contiguously, and
|
||||
the binary readers additionally require `resize()` and `operator[]`. See
|
||||
[Template Parameter Requirements](../../features/types/template_parameters.md#binarytype) for the full list.
|
||||
@@ -129,7 +129,9 @@ type `#!cpp binary_t*` must be dereferenced.
|
||||
|
||||
## See also
|
||||
|
||||
- [byte_container_with_subtype](../byte_container_with_subtype/index.md)
|
||||
- [Binary values](../../features/binary_values.md) - how binary values and subtypes are handled
|
||||
- [Binary formats](../../features/binary_formats/index.md) - formats that can store binary values
|
||||
- [`byte_container_with_subtype`](../byte_container_with_subtype/index.md) - container type used by binary values
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -34,7 +34,7 @@ copy/move-constructible, and support `push_back()`, `.data()`, and `.size()`, be
|
||||
[`byte_container_with_subtype`](https://json.nlohmann.me/api/byte_container_with_subtype/index.md) derives directly from it. Its
|
||||
`value_type` must additionally be exactly one byte wide (e.g., `std::uint8_t`/`char`/`std::byte`): the binary
|
||||
serializers (CBOR, MessagePack, BSON, UBJSON) read and write the container's raw bytes via
|
||||
`reinterpret_cast`, which is only correct for byte-sized elements -- a container like
|
||||
`reinterpret_cast`, which is only correct for byte-sized elements — a container like
|
||||
`std::vector<std::intptr_t>` will not work as `BinaryType`. The elements must be stored contiguously, and
|
||||
the binary readers additionally require `resize()` and `operator[]`. See
|
||||
[Template Parameter Requirements](https://json.nlohmann.me/features/types/template_parameters/#binarytype) for the full list.
|
||||
@@ -115,7 +115,9 @@ true
|
||||
|
||||
## See also
|
||||
|
||||
- [byte_container_with_subtype](https://json.nlohmann.me/api/byte_container_with_subtype/index.md)
|
||||
- [Binary values](https://json.nlohmann.me/features/binary_values/index.md) - how binary values and subtypes are handled
|
||||
- [Binary formats](https://json.nlohmann.me/features/binary_formats/index.md) - formats that can store binary values
|
||||
- [`byte_container_with_subtype`](https://json.nlohmann.me/api/byte_container_with_subtype/index.md) - container type used by binary values
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -58,7 +58,9 @@ Boolean values are stored directly inside a `basic_json` type.
|
||||
|
||||
## See also
|
||||
|
||||
- [is_boolean](is_boolean.md) checks whether the JSON value is a boolean
|
||||
- [`is_boolean`](is_boolean.md) - checks whether the JSON value is a boolean
|
||||
- [Types](../../features/types/index.md) - how booleans are stored
|
||||
- [Template Parameter Requirements](../../features/types/template_parameters.md) - requirements on the `BooleanType` template parameter
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -51,7 +51,9 @@ true
|
||||
|
||||
## See also
|
||||
|
||||
- [is_boolean](https://json.nlohmann.me/api/basic_json/is_boolean/index.md) checks whether the JSON value is a boolean
|
||||
- [`is_boolean`](https://json.nlohmann.me/api/basic_json/is_boolean/index.md) - checks whether the JSON value is a boolean
|
||||
- [Types](https://json.nlohmann.me/features/types/index.md) - how booleans are stored
|
||||
- [Template Parameter Requirements](https://json.nlohmann.me/features/types/template_parameters/index.md) - requirements on the `BooleanType` template parameter
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -6,7 +6,40 @@ const_iterator cbegin() const noexcept;
|
||||
|
||||
Returns an iterator to the first element.
|
||||
|
||||

|
||||
<div class="nj-fig-wrap" markdown>
|
||||
<svg class="nj-fig nj-fig--range" viewBox="0 0 600 150" role="img" aria-labelledby="fig-be-title" xmlns="http://www.w3.org/2000/svg">
|
||||
<title id="fig-be-title">A row of fifteen elements followed by a dashed past-the-last position. begin() points to the first element and end() points to the past-the-last position.</title>
|
||||
<defs><marker id="fig-be-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path class="fg-head" d="M0 1 L10 5 L0 9 z"/></marker></defs>
|
||||
<rect class="fg-cell" x="30" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="64" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="98" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="132" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="166" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="200" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="234" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="268" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="302" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="336" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="370" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="404" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="438" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="472" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="506" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell fg-cell--end" x="540" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-pill" x="15" y="8" width="60" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="45" y="24">begin</text>
|
||||
<line class="fg-arrow" x1="45" y1="32" x2="45" y2="60" marker-end="url(#fig-be-arrow)"/>
|
||||
<rect class="fg-pill" x="531" y="8" width="48" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="555" y="24">end</text>
|
||||
<line class="fg-arrow" x1="555" y1="32" x2="555" y2="60" marker-end="url(#fig-be-arrow)"/>
|
||||
<text class="fg-note fg-note--r" x="537" y="132">Past-the-last element</text>
|
||||
<line class="fg-arrow" x1="555" y1="124" x2="555" y2="96" marker-end="url(#fig-be-arrow)"/>
|
||||
</svg>
|
||||
|
||||
</div>
|
||||
|
||||
<p class="nj-caption" markdown>`cbegin()` points to the first element, like `begin()`, and `end()` to the position after
|
||||
the last element; the dashed cell is the past-the-last position, which must not be dereferenced.</p>
|
||||
|
||||
## Return value
|
||||
|
||||
@@ -55,11 +88,11 @@ Constant.
|
||||
|
||||
## See also
|
||||
|
||||
- [begin](begin.md) returns an iterator to the first element
|
||||
- [cend](cend.md) returns a const iterator to one past the last element
|
||||
- [crbegin](crbegin.md) returns a const reverse iterator to the last element
|
||||
- [`begin`](begin.md) - returns an iterator to the first element
|
||||
- [`cend`](cend.md) - returns a const iterator to one past the last element
|
||||
- [`crbegin`](crbegin.md) - returns a const reverse iterator to the last element
|
||||
- [Iterators](../../features/iterators.md) - the article on iterators
|
||||
- [basic_json_view::cbegin](../basic_json_view/cbegin.md) - the same iteration on a zero-copy view
|
||||
- [`basic_json_view::cbegin`](../basic_json_view/cbegin.md) - the same iteration on a zero-copy view
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -6,6 +6,8 @@ const_iterator cbegin() const noexcept;
|
||||
|
||||
Returns an iterator to the first element.
|
||||
|
||||
`cbegin()` points to the first element, like `begin()`, and `end()` to the position after the last element; the dashed cell is the past-the-last position, which must not be dereferenced.
|
||||
|
||||
## Return value
|
||||
|
||||
iterator to the first element
|
||||
@@ -51,11 +53,11 @@ Output:
|
||||
|
||||
## See also
|
||||
|
||||
- [begin](https://json.nlohmann.me/api/basic_json/begin/index.md) returns an iterator to the first element
|
||||
- [cend](https://json.nlohmann.me/api/basic_json/cend/index.md) returns a const iterator to one past the last element
|
||||
- [crbegin](https://json.nlohmann.me/api/basic_json/crbegin/index.md) returns a const reverse iterator to the last element
|
||||
- [`begin`](https://json.nlohmann.me/api/basic_json/begin/index.md) - returns an iterator to the first element
|
||||
- [`cend`](https://json.nlohmann.me/api/basic_json/cend/index.md) - returns a const iterator to one past the last element
|
||||
- [`crbegin`](https://json.nlohmann.me/api/basic_json/crbegin/index.md) - returns a const reverse iterator to the last element
|
||||
- [Iterators](https://json.nlohmann.me/features/iterators/index.md) - the article on iterators
|
||||
- [basic_json_view::cbegin](https://json.nlohmann.me/api/basic_json_view/cbegin/index.md) - the same iteration on a zero-copy view
|
||||
- [`basic_json_view::cbegin`](https://json.nlohmann.me/api/basic_json_view/cbegin/index.md) - the same iteration on a zero-copy view
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -73,8 +73,9 @@ store
|
||||
|
||||
## See also
|
||||
|
||||
- [from_cbor](from_cbor.md) deserializes a JSON value from CBOR
|
||||
- [input_format_t](input_format_t.md) the enumeration of supported input formats
|
||||
- [Binary values](../../features/binary_values.md) - how binary values and subtypes are handled
|
||||
- [`from_cbor`](from_cbor.md) - deserializes a JSON value from CBOR
|
||||
- [`input_format_t`](input_format_t.md) - the enumeration of supported input formats
|
||||
- [CBOR](../../features/binary_formats/cbor.md) - the article on the CBOR format
|
||||
|
||||
## Version history
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -64,8 +64,9 @@ Output:
|
||||
|
||||
## See also
|
||||
|
||||
- [from_cbor](https://json.nlohmann.me/api/basic_json/from_cbor/index.md) deserializes a JSON value from CBOR
|
||||
- [input_format_t](https://json.nlohmann.me/api/basic_json/input_format_t/index.md) the enumeration of supported input formats
|
||||
- [Binary values](https://json.nlohmann.me/features/binary_values/index.md) - how binary values and subtypes are handled
|
||||
- [`from_cbor`](https://json.nlohmann.me/api/basic_json/from_cbor/index.md) - deserializes a JSON value from CBOR
|
||||
- [`input_format_t`](https://json.nlohmann.me/api/basic_json/input_format_t/index.md) - the enumeration of supported input formats
|
||||
- [CBOR](https://json.nlohmann.me/features/binary_formats/cbor/index.md) - the article on the CBOR format
|
||||
|
||||
## Version history
|
||||
|
||||
+38
-5
@@ -6,7 +6,40 @@ const_iterator cend() const noexcept;
|
||||
|
||||
Returns an iterator to one past the last element.
|
||||
|
||||

|
||||
<div class="nj-fig-wrap" markdown>
|
||||
<svg class="nj-fig nj-fig--range" viewBox="0 0 600 150" role="img" aria-labelledby="fig-be-title" xmlns="http://www.w3.org/2000/svg">
|
||||
<title id="fig-be-title">A row of fifteen elements followed by a dashed past-the-last position. begin() points to the first element and end() points to the past-the-last position.</title>
|
||||
<defs><marker id="fig-be-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path class="fg-head" d="M0 1 L10 5 L0 9 z"/></marker></defs>
|
||||
<rect class="fg-cell" x="30" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="64" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="98" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="132" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="166" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="200" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="234" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="268" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="302" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="336" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="370" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="404" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="438" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="472" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="506" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell fg-cell--end" x="540" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-pill" x="15" y="8" width="60" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="45" y="24">begin</text>
|
||||
<line class="fg-arrow" x1="45" y1="32" x2="45" y2="60" marker-end="url(#fig-be-arrow)"/>
|
||||
<rect class="fg-pill" x="531" y="8" width="48" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="555" y="24">end</text>
|
||||
<line class="fg-arrow" x1="555" y1="32" x2="555" y2="60" marker-end="url(#fig-be-arrow)"/>
|
||||
<text class="fg-note fg-note--r" x="537" y="132">Past-the-last element</text>
|
||||
<line class="fg-arrow" x1="555" y1="124" x2="555" y2="96" marker-end="url(#fig-be-arrow)"/>
|
||||
</svg>
|
||||
|
||||
</div>
|
||||
|
||||
<p class="nj-caption" markdown>`cend()` points to the position after the last element, like `end()`, and `begin()` to
|
||||
the first element; the dashed cell is the past-the-last position, which must not be dereferenced.</p>
|
||||
|
||||
## Return value
|
||||
|
||||
@@ -58,11 +91,11 @@ Constant.
|
||||
|
||||
## See also
|
||||
|
||||
- [end](end.md) returns an iterator to one past the last element
|
||||
- [cbegin](cbegin.md) returns a const iterator to the first element
|
||||
- [crend](crend.md) returns a const reverse iterator to one before the first element
|
||||
- [`end`](end.md) - returns an iterator to one past the last element
|
||||
- [`cbegin`](cbegin.md) - returns a const iterator to the first element
|
||||
- [`crend`](crend.md) - returns a const reverse iterator to one before the first element
|
||||
- [Iterators](../../features/iterators.md) - the article on iterators
|
||||
- [basic_json_view::cend](../basic_json_view/cend.md) - the same iteration on a zero-copy view
|
||||
- [`basic_json_view::cend`](../basic_json_view/cend.md) - the same iteration on a zero-copy view
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -6,6 +6,8 @@ const_iterator cend() const noexcept;
|
||||
|
||||
Returns an iterator to one past the last element.
|
||||
|
||||
`cend()` points to the position after the last element, like `end()`, and `begin()` to the first element; the dashed cell is the past-the-last position, which must not be dereferenced.
|
||||
|
||||
## Return value
|
||||
|
||||
iterator one past the last element
|
||||
@@ -54,11 +56,11 @@ Output:
|
||||
|
||||
## See also
|
||||
|
||||
- [end](https://json.nlohmann.me/api/basic_json/end/index.md) returns an iterator to one past the last element
|
||||
- [cbegin](https://json.nlohmann.me/api/basic_json/cbegin/index.md) returns a const iterator to the first element
|
||||
- [crend](https://json.nlohmann.me/api/basic_json/crend/index.md) returns a const reverse iterator to one before the first element
|
||||
- [`end`](https://json.nlohmann.me/api/basic_json/end/index.md) - returns an iterator to one past the last element
|
||||
- [`cbegin`](https://json.nlohmann.me/api/basic_json/cbegin/index.md) - returns a const iterator to the first element
|
||||
- [`crend`](https://json.nlohmann.me/api/basic_json/crend/index.md) - returns a const reverse iterator to one before the first element
|
||||
- [Iterators](https://json.nlohmann.me/features/iterators/index.md) - the article on iterators
|
||||
- [basic_json_view::cend](https://json.nlohmann.me/api/basic_json_view/cend/index.md) - the same iteration on a zero-copy view
|
||||
- [`basic_json_view::cend`](https://json.nlohmann.me/api/basic_json_view/cend/index.md) - the same iteration on a zero-copy view
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -95,8 +95,9 @@ All iterators, pointers, and references related to this container are invalidate
|
||||
|
||||
## See also
|
||||
|
||||
- [erase](erase.md) removes elements from a JSON value
|
||||
- [empty](empty.md) checks whether the JSON value has no elements
|
||||
- [`erase`](erase.md) - removes elements from a JSON value
|
||||
- [`empty`](empty.md) - checks whether the JSON value has no elements
|
||||
- [Modifying values](../../features/modifying_values.md) - the article on modifying values
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -91,8 +91,9 @@ false
|
||||
|
||||
## See also
|
||||
|
||||
- [erase](https://json.nlohmann.me/api/basic_json/erase/index.md) removes elements from a JSON value
|
||||
- [empty](https://json.nlohmann.me/api/basic_json/empty/index.md) checks whether the JSON value has no elements
|
||||
- [`erase`](https://json.nlohmann.me/api/basic_json/erase/index.md) - removes elements from a JSON value
|
||||
- [`empty`](https://json.nlohmann.me/api/basic_json/empty/index.md) - checks whether the JSON value has no elements
|
||||
- [Modifying values](https://json.nlohmann.me/features/modifying_values/index.md) - the article on modifying values
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -221,9 +221,10 @@ Strong exception safety: if an exception occurs, the original value stays intact
|
||||
|
||||
## See also
|
||||
|
||||
- [find](find.md) find a value in an object
|
||||
- [count](count.md) returns the number of occurrences of a key
|
||||
- [basic_json_view::contains](../basic_json_view/contains.md) - the same check on a zero-copy view
|
||||
- [`find`](find.md) - find a value in an object
|
||||
- [`count`](count.md) - returns the number of occurrences of a key
|
||||
- [`basic_json_view::contains`](../basic_json_view/contains.md) - the same check on a zero-copy view
|
||||
- [Element Access](../../features/element_access/index.md#does-this-key-exist) - how to test whether a key exists
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -194,9 +194,10 @@ false
|
||||
|
||||
## See also
|
||||
|
||||
- [find](https://json.nlohmann.me/api/basic_json/find/index.md) find a value in an object
|
||||
- [count](https://json.nlohmann.me/api/basic_json/count/index.md) returns the number of occurrences of a key
|
||||
- [basic_json_view::contains](https://json.nlohmann.me/api/basic_json_view/contains/index.md) - the same check on a zero-copy view
|
||||
- [`find`](https://json.nlohmann.me/api/basic_json/find/index.md) - find a value in an object
|
||||
- [`count`](https://json.nlohmann.me/api/basic_json/count/index.md) - returns the number of occurrences of a key
|
||||
- [`basic_json_view::contains`](https://json.nlohmann.me/api/basic_json_view/contains/index.md) - the same check on a zero-copy view
|
||||
- [Element Access](https://json.nlohmann.me/features/element_access/#does-this-key-exist) - how to test whether a key exists
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -127,9 +127,10 @@ Logarithmic in the size of the JSON object.
|
||||
|
||||
## See also
|
||||
|
||||
- [find](find.md) find a value in an object
|
||||
- [contains](contains.md) checks whether a key exists
|
||||
- [basic_json_view::count](../basic_json_view/count.md) - the same check on a zero-copy view
|
||||
- [`find`](find.md) - find a value in an object
|
||||
- [`contains`](contains.md) - checks whether a key exists
|
||||
- [`basic_json_view::count`](../basic_json_view/count.md) - the same check on a zero-copy view
|
||||
- [Element Access](../../features/element_access/index.md#does-this-key-exist) - how to test whether a key exists
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -112,9 +112,10 @@ number of elements with key "three": 0
|
||||
|
||||
## See also
|
||||
|
||||
- [find](https://json.nlohmann.me/api/basic_json/find/index.md) find a value in an object
|
||||
- [contains](https://json.nlohmann.me/api/basic_json/contains/index.md) checks whether a key exists
|
||||
- [basic_json_view::count](https://json.nlohmann.me/api/basic_json_view/count/index.md) - the same check on a zero-copy view
|
||||
- [`find`](https://json.nlohmann.me/api/basic_json/find/index.md) - find a value in an object
|
||||
- [`contains`](https://json.nlohmann.me/api/basic_json/contains/index.md) - checks whether a key exists
|
||||
- [`basic_json_view::count`](https://json.nlohmann.me/api/basic_json_view/count/index.md) - the same check on a zero-copy view
|
||||
- [Element Access](https://json.nlohmann.me/features/element_access/#does-this-key-exist) - how to test whether a key exists
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -6,7 +6,67 @@ const_reverse_iterator crbegin() const noexcept;
|
||||
|
||||
Returns an iterator to the reverse-beginning; that is, the last element.
|
||||
|
||||

|
||||
<div class="nj-fig-wrap" markdown>
|
||||
<svg class="nj-fig nj-fig--range" viewBox="0 0 600 236" role="img" aria-labelledby="fig-rbe-title" xmlns="http://www.w3.org/2000/svg">
|
||||
<title id="fig-rbe-title">Two rows of sixteen cells. The upper row shows the reversed sequence: rend() points to a dashed position before the first element and rbegin() to the last element. The lower row shows the forward sequence: begin() points to the first element and end() to a dashed position after the last element. A reverse iterator stores an iterator to the next element, so rend() corresponds to begin() and rbegin() to end().</title>
|
||||
<defs><marker id="fig-rbe-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path class="fg-head" d="M0 1 L10 5 L0 9 z"/></marker></defs>
|
||||
<rect class="fg-cell fg-cell--end" x="30" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="64" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="98" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="132" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="166" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="200" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="234" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="268" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="302" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="336" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="370" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="404" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="438" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="472" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="506" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="540" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="30" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="64" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="98" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="132" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="166" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="200" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="234" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="268" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="302" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="336" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="370" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="404" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="438" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="472" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="506" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell fg-cell--end" x="540" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-pill" x="19" y="8" width="52" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="45" y="24">rend</text>
|
||||
<line class="fg-arrow" x1="45" y1="32" x2="45" y2="60" marker-end="url(#fig-rbe-arrow)"/>
|
||||
<rect class="fg-pill" x="521" y="8" width="68" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="555" y="24">rbegin</text>
|
||||
<line class="fg-arrow" x1="555" y1="32" x2="555" y2="60" marker-end="url(#fig-rbe-arrow)"/>
|
||||
<text class="fg-note fg-note--l" x="81" y="24">Reverse past-the-last element</text>
|
||||
<line class="fg-arrow fg-arrow--dash" x1="45" y1="94" x2="45" y2="142"/>
|
||||
<line class="fg-arrow fg-arrow--dash" x1="555" y1="94" x2="555" y2="142"/>
|
||||
<text class="fg-note" x="300" y="123">A reverse iterator stores an iterator to the next element</text>
|
||||
<text class="fg-note" x="300" y="141" dy="0" style="display:none"></text>
|
||||
<rect class="fg-pill" x="15" y="204" width="60" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="45" y="220">begin</text>
|
||||
<line class="fg-arrow" x1="45" y1="202" x2="45" y2="178" marker-end="url(#fig-rbe-arrow)"/>
|
||||
<rect class="fg-pill" x="531" y="204" width="48" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="555" y="220">end</text>
|
||||
<line class="fg-arrow" x1="555" y1="202" x2="555" y2="178" marker-end="url(#fig-rbe-arrow)"/>
|
||||
<text class="fg-note fg-note--r" x="515" y="221">Past-the-last element</text>
|
||||
</svg>
|
||||
|
||||
</div>
|
||||
|
||||
<p class="nj-caption" markdown>`crbegin()` points to the last element, like `rbegin()`, and `rend()` to the position
|
||||
before the first element. The upper row is the reversed sequence and the lower row the forward sequence; dashed arrows
|
||||
link each reverse iterator to the forward iterator it stores, and dashed cells are past-the-last positions.</p>
|
||||
|
||||
## Return value
|
||||
|
||||
@@ -55,9 +115,9 @@ Constant.
|
||||
|
||||
## See also
|
||||
|
||||
- [crend](crend.md) returns a const reverse iterator to one before the first element
|
||||
- [rbegin](rbegin.md) returns a reverse iterator to the last element
|
||||
- [cbegin](cbegin.md) returns a const iterator to the first element
|
||||
- [`crend`](crend.md) - returns a const reverse iterator to one before the first element
|
||||
- [`rbegin`](rbegin.md) - returns a reverse iterator to the last element
|
||||
- [`cbegin`](cbegin.md) - returns a const iterator to the first element
|
||||
- [Iterators](../../features/iterators.md) - the article on iterators
|
||||
|
||||
## Version history
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -6,6 +6,8 @@ const_reverse_iterator crbegin() const noexcept;
|
||||
|
||||
Returns an iterator to the reverse-beginning; that is, the last element.
|
||||
|
||||
`crbegin()` points to the last element, like `rbegin()`, and `rend()` to the position before the first element. The upper row is the reversed sequence and the lower row the forward sequence; dashed arrows link each reverse iterator to the forward iterator it stores, and dashed cells are past-the-last positions.
|
||||
|
||||
## Return value
|
||||
|
||||
reverse iterator to the last element
|
||||
@@ -51,9 +53,9 @@ Output:
|
||||
|
||||
## See also
|
||||
|
||||
- [crend](https://json.nlohmann.me/api/basic_json/crend/index.md) returns a const reverse iterator to one before the first element
|
||||
- [rbegin](https://json.nlohmann.me/api/basic_json/rbegin/index.md) returns a reverse iterator to the last element
|
||||
- [cbegin](https://json.nlohmann.me/api/basic_json/cbegin/index.md) returns a const iterator to the first element
|
||||
- [`crend`](https://json.nlohmann.me/api/basic_json/crend/index.md) - returns a const reverse iterator to one before the first element
|
||||
- [`rbegin`](https://json.nlohmann.me/api/basic_json/rbegin/index.md) - returns a reverse iterator to the last element
|
||||
- [`cbegin`](https://json.nlohmann.me/api/basic_json/cbegin/index.md) - returns a const iterator to the first element
|
||||
- [Iterators](https://json.nlohmann.me/features/iterators/index.md) - the article on iterators
|
||||
|
||||
## Version history
|
||||
|
||||
+64
-4
@@ -7,7 +7,67 @@ const_reverse_iterator crend() const noexcept;
|
||||
Returns an iterator to the reverse-end; that is, one before the first element. This element acts as a placeholder,
|
||||
attempting to access it results in undefined behavior.
|
||||
|
||||

|
||||
<div class="nj-fig-wrap" markdown>
|
||||
<svg class="nj-fig nj-fig--range" viewBox="0 0 600 236" role="img" aria-labelledby="fig-rbe-title" xmlns="http://www.w3.org/2000/svg">
|
||||
<title id="fig-rbe-title">Two rows of sixteen cells. The upper row shows the reversed sequence: rend() points to a dashed position before the first element and rbegin() to the last element. The lower row shows the forward sequence: begin() points to the first element and end() to a dashed position after the last element. A reverse iterator stores an iterator to the next element, so rend() corresponds to begin() and rbegin() to end().</title>
|
||||
<defs><marker id="fig-rbe-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path class="fg-head" d="M0 1 L10 5 L0 9 z"/></marker></defs>
|
||||
<rect class="fg-cell fg-cell--end" x="30" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="64" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="98" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="132" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="166" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="200" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="234" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="268" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="302" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="336" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="370" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="404" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="438" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="472" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="506" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="540" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="30" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="64" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="98" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="132" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="166" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="200" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="234" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="268" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="302" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="336" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="370" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="404" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="438" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="472" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="506" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell fg-cell--end" x="540" y="144" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-pill" x="19" y="8" width="52" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="45" y="24">rend</text>
|
||||
<line class="fg-arrow" x1="45" y1="32" x2="45" y2="60" marker-end="url(#fig-rbe-arrow)"/>
|
||||
<rect class="fg-pill" x="521" y="8" width="68" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="555" y="24">rbegin</text>
|
||||
<line class="fg-arrow" x1="555" y1="32" x2="555" y2="60" marker-end="url(#fig-rbe-arrow)"/>
|
||||
<text class="fg-note fg-note--l" x="81" y="24">Reverse past-the-last element</text>
|
||||
<line class="fg-arrow fg-arrow--dash" x1="45" y1="94" x2="45" y2="142"/>
|
||||
<line class="fg-arrow fg-arrow--dash" x1="555" y1="94" x2="555" y2="142"/>
|
||||
<text class="fg-note" x="300" y="123">A reverse iterator stores an iterator to the next element</text>
|
||||
<text class="fg-note" x="300" y="141" dy="0" style="display:none"></text>
|
||||
<rect class="fg-pill" x="15" y="204" width="60" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="45" y="220">begin</text>
|
||||
<line class="fg-arrow" x1="45" y1="202" x2="45" y2="178" marker-end="url(#fig-rbe-arrow)"/>
|
||||
<rect class="fg-pill" x="531" y="204" width="48" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="555" y="220">end</text>
|
||||
<line class="fg-arrow" x1="555" y1="202" x2="555" y2="178" marker-end="url(#fig-rbe-arrow)"/>
|
||||
<text class="fg-note fg-note--r" x="515" y="221">Past-the-last element</text>
|
||||
</svg>
|
||||
|
||||
</div>
|
||||
|
||||
<p class="nj-caption" markdown>`crend()` points to the position before the first element, like `rend()`, and `rbegin()`
|
||||
to the last element. The upper row is the reversed sequence and the lower row the forward sequence; dashed arrows link
|
||||
each reverse iterator to the forward iterator it stores, and dashed cells are past-the-last positions.</p>
|
||||
|
||||
## Return value
|
||||
|
||||
@@ -59,9 +119,9 @@ Constant.
|
||||
|
||||
## See also
|
||||
|
||||
- [crbegin](crbegin.md) returns a const reverse iterator to the last element
|
||||
- [rend](rend.md) returns a reverse iterator to one before the first element
|
||||
- [cend](cend.md) returns a const iterator to one past the last element
|
||||
- [`crbegin`](crbegin.md) - returns a const reverse iterator to the last element
|
||||
- [`rend`](rend.md) - returns a reverse iterator to one before the first element
|
||||
- [`cend`](cend.md) - returns a const iterator to one past the last element
|
||||
- [Iterators](../../features/iterators.md) - the article on iterators
|
||||
|
||||
## Version history
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -6,6 +6,8 @@ const_reverse_iterator crend() const noexcept;
|
||||
|
||||
Returns an iterator to the reverse-end; that is, one before the first element. This element acts as a placeholder, attempting to access it results in undefined behavior.
|
||||
|
||||
`crend()` points to the position before the first element, like `rend()`, and `rbegin()` to the last element. The upper row is the reversed sequence and the lower row the forward sequence; dashed arrows link each reverse iterator to the forward iterator it stores, and dashed cells are past-the-last positions.
|
||||
|
||||
## Return value
|
||||
|
||||
reverse iterator to the element following the last element
|
||||
@@ -54,9 +56,9 @@ Output:
|
||||
|
||||
## See also
|
||||
|
||||
- [crbegin](https://json.nlohmann.me/api/basic_json/crbegin/index.md) returns a const reverse iterator to the last element
|
||||
- [rend](https://json.nlohmann.me/api/basic_json/rend/index.md) returns a reverse iterator to one before the first element
|
||||
- [cend](https://json.nlohmann.me/api/basic_json/cend/index.md) returns a const iterator to one past the last element
|
||||
- [`crbegin`](https://json.nlohmann.me/api/basic_json/crbegin/index.md) - returns a const reverse iterator to the last element
|
||||
- [`rend`](https://json.nlohmann.me/api/basic_json/rend/index.md) - returns a reverse iterator to one before the first element
|
||||
- [`cend`](https://json.nlohmann.me/api/basic_json/cend/index.md) - returns a const iterator to one past the last element
|
||||
- [Iterators](https://json.nlohmann.me/features/iterators/index.md) - the article on iterators
|
||||
|
||||
## Version history
|
||||
|
||||
@@ -45,8 +45,10 @@ The actual comparator used depends on [`object_t`](object_t.md) and can be obtai
|
||||
|
||||
## See also
|
||||
|
||||
- [object_comparator_t](object_comparator_t.md) the comparator actually used by `object_t`
|
||||
- [object_t](object_t.md) the type used to store JSON objects
|
||||
- [`object_comparator_t`](object_comparator_t.md) - the comparator actually used by `object_t`
|
||||
- [`object_t`](object_t.md) - the type used to store JSON objects
|
||||
- [Template Parameter Requirements](../../features/types/template_parameters.md) - requirements on the `ObjectType` template parameter
|
||||
- [Object order](../../features/object_order.md) - preserve the insertion order of keys
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -41,8 +41,10 @@ three < four : false
|
||||
|
||||
## See also
|
||||
|
||||
- [object_comparator_t](https://json.nlohmann.me/api/basic_json/object_comparator_t/index.md) the comparator actually used by `object_t`
|
||||
- [object_t](https://json.nlohmann.me/api/basic_json/object_t/index.md) the type used to store JSON objects
|
||||
- [`object_comparator_t`](https://json.nlohmann.me/api/basic_json/object_comparator_t/index.md) - the comparator actually used by `object_t`
|
||||
- [`object_t`](https://json.nlohmann.me/api/basic_json/object_t/index.md) - the type used to store JSON objects
|
||||
- [Template Parameter Requirements](https://json.nlohmann.me/features/types/template_parameters/index.md) - requirements on the `ObjectType` template parameter
|
||||
- [Object order](https://json.nlohmann.me/features/object_order/index.md) - preserve the insertion order of keys
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -154,11 +154,12 @@ operations times the length of their paths, so a small change deep inside a valu
|
||||
|
||||
## See also
|
||||
|
||||
- [RFC 6902 (JSON Patch)](https://tools.ietf.org/html/rfc6902)
|
||||
- [patch](patch.md) applies a JSON Patch
|
||||
- [patch_inplace](patch_inplace.md) applies a JSON Patch in place
|
||||
- [merge_patch](merge_patch.md) applies a JSON Merge Patch
|
||||
- [merge_diff](merge_diff.md) creates a diff as a JSON Merge Patch
|
||||
- [RFC 6902 (JSON Patch)](https://tools.ietf.org/html/rfc6902) - specification of JSON Patch
|
||||
- [`patch`](patch.md) - applies a JSON Patch
|
||||
- [`patch_inplace`](patch_inplace.md) - applies a JSON Patch in place
|
||||
- [`merge_patch`](merge_patch.md) - applies a JSON Merge Patch
|
||||
- [`merge_diff`](merge_diff.md) - creates a diff as a JSON Merge Patch
|
||||
- [JSON Patch and Diff](../../features/json_patch.md) - the article on JSON Patch
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -127,11 +127,12 @@ Output:
|
||||
|
||||
## See also
|
||||
|
||||
- [RFC 6902 (JSON Patch)](https://tools.ietf.org/html/rfc6902)
|
||||
- [patch](https://json.nlohmann.me/api/basic_json/patch/index.md) applies a JSON Patch
|
||||
- [patch_inplace](https://json.nlohmann.me/api/basic_json/patch_inplace/index.md) applies a JSON Patch in place
|
||||
- [merge_patch](https://json.nlohmann.me/api/basic_json/merge_patch/index.md) applies a JSON Merge Patch
|
||||
- [merge_diff](https://json.nlohmann.me/api/basic_json/merge_diff/index.md) creates a diff as a JSON Merge Patch
|
||||
- [RFC 6902 (JSON Patch)](https://tools.ietf.org/html/rfc6902) - specification of JSON Patch
|
||||
- [`patch`](https://json.nlohmann.me/api/basic_json/patch/index.md) - applies a JSON Patch
|
||||
- [`patch_inplace`](https://json.nlohmann.me/api/basic_json/patch_inplace/index.md) - applies a JSON Patch in place
|
||||
- [`merge_patch`](https://json.nlohmann.me/api/basic_json/merge_patch/index.md) - applies a JSON Merge Patch
|
||||
- [`merge_diff`](https://json.nlohmann.me/api/basic_json/merge_diff/index.md) - creates a diff as a JSON Merge Patch
|
||||
- [JSON Patch and Diff](https://json.nlohmann.me/features/json_patch/index.md) - the article on JSON Patch
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -192,9 +192,9 @@ Binary values are serialized as an object containing two keys:
|
||||
|
||||
## See also
|
||||
|
||||
- [to_string](to_string.md) returns a string representation of a JSON value
|
||||
- [operator<<](../operator_ltlt.md) serialize to stream
|
||||
- [`basic_json_view::dump`](../basic_json_view/dump.md) the corresponding function of `basic_json_view`, serializing
|
||||
- [`to_string`](to_string.md) - returns a string representation of a JSON value
|
||||
- [`operator<<`](../operator_ltlt.md) - serialize to stream
|
||||
- [`basic_json_view::dump`](../basic_json_view/dump.md) - the corresponding function of `basic_json_view`, serializing
|
||||
directly from a flat index without building a `basic_json` value
|
||||
- [Serialization](../../features/serialization.md) - the serialization article
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -169,9 +169,9 @@ string with ignored invalid characters: "äü"
|
||||
|
||||
## See also
|
||||
|
||||
- [to_string](https://json.nlohmann.me/api/basic_json/to_string/index.md) returns a string representation of a JSON value
|
||||
- [operator\<<](https://json.nlohmann.me/api/operator_ltlt/index.md) serialize to stream
|
||||
- [`basic_json_view::dump`](https://json.nlohmann.me/api/basic_json_view/dump/index.md) the corresponding function of `basic_json_view`, serializing directly from a flat index without building a `basic_json` value
|
||||
- [`to_string`](https://json.nlohmann.me/api/basic_json/to_string/index.md) - returns a string representation of a JSON value
|
||||
- [`operator<<`](https://json.nlohmann.me/api/operator_ltlt/index.md) - serialize to stream
|
||||
- [`basic_json_view::dump`](https://json.nlohmann.me/api/basic_json_view/dump/index.md) - the corresponding function of `basic_json_view`, serializing directly from a flat index without building a `basic_json` value
|
||||
- [Serialization](https://json.nlohmann.me/features/serialization/index.md) - the serialization article
|
||||
|
||||
## Version history
|
||||
|
||||
@@ -100,8 +100,8 @@ Logarithmic in the size of the container, O(log(`size()`)).
|
||||
|
||||
## See also
|
||||
|
||||
- [emplace_back](emplace_back.md) add a value to an array
|
||||
- [insert](insert.md) add values to an array/object
|
||||
- [`emplace_back`](emplace_back.md) - add a value to an array
|
||||
- [`insert`](insert.md) - add values to an array/object
|
||||
- [Modifying values](../../features/modifying_values.md) - the article on modifying values
|
||||
|
||||
## Version history
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -88,8 +88,8 @@ null
|
||||
|
||||
## See also
|
||||
|
||||
- [emplace_back](https://json.nlohmann.me/api/basic_json/emplace_back/index.md) add a value to an array
|
||||
- [insert](https://json.nlohmann.me/api/basic_json/insert/index.md) add values to an array/object
|
||||
- [`emplace_back`](https://json.nlohmann.me/api/basic_json/emplace_back/index.md) - add a value to an array
|
||||
- [`insert`](https://json.nlohmann.me/api/basic_json/insert/index.md) - add values to an array/object
|
||||
- [Modifying values](https://json.nlohmann.me/features/modifying_values/index.md) - the article on modifying values
|
||||
|
||||
## Version history
|
||||
|
||||
@@ -89,8 +89,8 @@ Amortized constant.
|
||||
|
||||
## See also
|
||||
|
||||
- [operator+=](operator+=.md) add a value to an array/object
|
||||
- [push_back](push_back.md) add a value to an array/object
|
||||
- [`operator+=`](operator+=.md) - add a value to an array/object
|
||||
- [`push_back`](push_back.md) - add a value to an array/object
|
||||
- [Modifying values](../../features/modifying_values.md) - the article on modifying values
|
||||
|
||||
## Version history
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -79,8 +79,8 @@ null
|
||||
|
||||
## See also
|
||||
|
||||
- [operator+=](https://json.nlohmann.me/api/basic_json/operator%2B%3D/index.md) add a value to an array/object
|
||||
- [push_back](https://json.nlohmann.me/api/basic_json/push_back/index.md) add a value to an array/object
|
||||
- [`operator+=`](https://json.nlohmann.me/api/basic_json/operator%2B%3D/index.md) - add a value to an array/object
|
||||
- [`push_back`](https://json.nlohmann.me/api/basic_json/push_back/index.md) - add a value to an array/object
|
||||
- [Modifying values](https://json.nlohmann.me/features/modifying_values/index.md) - the article on modifying values
|
||||
|
||||
## Version history
|
||||
|
||||
@@ -41,7 +41,7 @@ bool empty() const noexcept
|
||||
|
||||
## Notes
|
||||
|
||||
This function does not return whether a string stored as JSON value is empty -- it returns whether the JSON container
|
||||
This function does not return whether a string stored as JSON value is empty — it returns whether the JSON container
|
||||
itself is empty which is `#!cpp false` in the case of a string.
|
||||
|
||||
## Examples
|
||||
@@ -101,9 +101,9 @@ itself is empty which is `#!cpp false` in the case of a string.
|
||||
|
||||
## See also
|
||||
|
||||
- [size](size.md) returns the number of elements
|
||||
- [clear](clear.md) clears the content and resets the value to the default value
|
||||
- [basic_json_view::empty](../basic_json_view/empty.md) - the same check on a zero-copy view
|
||||
- [`size`](size.md) - returns the number of elements
|
||||
- [`clear`](clear.md) - clears the content and resets the value to the default value
|
||||
- [`basic_json_view::empty`](../basic_json_view/empty.md) - the same check on a zero-copy view
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -39,7 +39,7 @@ bool empty() const noexcept
|
||||
|
||||
## Notes
|
||||
|
||||
This function does not return whether a string stored as JSON value is empty -- it returns whether the JSON container itself is empty which is `false` in the case of a string.
|
||||
This function does not return whether a string stored as JSON value is empty — it returns whether the JSON container itself is empty which is `false` in the case of a string.
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -96,9 +96,9 @@ false
|
||||
|
||||
## See also
|
||||
|
||||
- [size](https://json.nlohmann.me/api/basic_json/size/index.md) returns the number of elements
|
||||
- [clear](https://json.nlohmann.me/api/basic_json/clear/index.md) clears the content and resets the value to the default value
|
||||
- [basic_json_view::empty](https://json.nlohmann.me/api/basic_json_view/empty/index.md) - the same check on a zero-copy view
|
||||
- [`size`](https://json.nlohmann.me/api/basic_json/size/index.md) - returns the number of elements
|
||||
- [`clear`](https://json.nlohmann.me/api/basic_json/clear/index.md) - clears the content and resets the value to the default value
|
||||
- [`basic_json_view::empty`](https://json.nlohmann.me/api/basic_json_view/empty/index.md) - the same check on a zero-copy view
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
+38
-5
@@ -7,7 +7,40 @@ const_iterator end() const noexcept;
|
||||
|
||||
Returns an iterator to one past the last element.
|
||||
|
||||

|
||||
<div class="nj-fig-wrap" markdown>
|
||||
<svg class="nj-fig nj-fig--range" viewBox="0 0 600 150" role="img" aria-labelledby="fig-be-title" xmlns="http://www.w3.org/2000/svg">
|
||||
<title id="fig-be-title">A row of fifteen elements followed by a dashed past-the-last position. begin() points to the first element and end() points to the past-the-last position.</title>
|
||||
<defs><marker id="fig-be-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path class="fg-head" d="M0 1 L10 5 L0 9 z"/></marker></defs>
|
||||
<rect class="fg-cell" x="30" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="64" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="98" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="132" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="166" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="200" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="234" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="268" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="302" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="336" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="370" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="404" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="438" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="472" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell" x="506" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-cell fg-cell--end" x="540" y="62" width="30" height="30" rx="5"/>
|
||||
<rect class="fg-pill" x="15" y="8" width="60" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="45" y="24">begin</text>
|
||||
<line class="fg-arrow" x1="45" y1="32" x2="45" y2="60" marker-end="url(#fig-be-arrow)"/>
|
||||
<rect class="fg-pill" x="531" y="8" width="48" height="24" rx="6"/>
|
||||
<text class="fg-pilltext" x="555" y="24">end</text>
|
||||
<line class="fg-arrow" x1="555" y1="32" x2="555" y2="60" marker-end="url(#fig-be-arrow)"/>
|
||||
<text class="fg-note fg-note--r" x="537" y="132">Past-the-last element</text>
|
||||
<line class="fg-arrow" x1="555" y1="124" x2="555" y2="96" marker-end="url(#fig-be-arrow)"/>
|
||||
</svg>
|
||||
|
||||
</div>
|
||||
|
||||
<p class="nj-caption" markdown>`end()` points to the position after the last element and `begin()` to the first element;
|
||||
the dashed cell is the past-the-last position, which must not be dereferenced.</p>
|
||||
|
||||
## Return value
|
||||
|
||||
@@ -59,11 +92,11 @@ Constant.
|
||||
|
||||
## See also
|
||||
|
||||
- [begin](begin.md) returns an iterator to the first element
|
||||
- [cend](cend.md) returns a const iterator to one past the last element
|
||||
- [rend](rend.md) returns a reverse iterator to one before the first element
|
||||
- [`begin`](begin.md) - returns an iterator to the first element
|
||||
- [`cend`](cend.md) - returns a const iterator to one past the last element
|
||||
- [`rend`](rend.md) - returns a reverse iterator to one before the first element
|
||||
- [Iterators](../../features/iterators.md) - the article on iterators
|
||||
- [basic_json_view::end](../basic_json_view/end.md) - the same iteration on a zero-copy view
|
||||
- [`basic_json_view::end`](../basic_json_view/end.md) - the same iteration on a zero-copy view
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -7,6 +7,8 @@ const_iterator end() const noexcept;
|
||||
|
||||
Returns an iterator to one past the last element.
|
||||
|
||||
`end()` points to the position after the last element and `begin()` to the first element; the dashed cell is the past-the-last position, which must not be dereferenced.
|
||||
|
||||
## Return value
|
||||
|
||||
iterator one past the last element
|
||||
@@ -55,11 +57,11 @@ Output:
|
||||
|
||||
## See also
|
||||
|
||||
- [begin](https://json.nlohmann.me/api/basic_json/begin/index.md) returns an iterator to the first element
|
||||
- [cend](https://json.nlohmann.me/api/basic_json/cend/index.md) returns a const iterator to one past the last element
|
||||
- [rend](https://json.nlohmann.me/api/basic_json/rend/index.md) returns a reverse iterator to one before the first element
|
||||
- [`begin`](https://json.nlohmann.me/api/basic_json/begin/index.md) - returns an iterator to the first element
|
||||
- [`cend`](https://json.nlohmann.me/api/basic_json/cend/index.md) - returns a const iterator to one past the last element
|
||||
- [`rend`](https://json.nlohmann.me/api/basic_json/rend/index.md) - returns a reverse iterator to one before the first element
|
||||
- [Iterators](https://json.nlohmann.me/features/iterators/index.md) - the article on iterators
|
||||
- [basic_json_view::end](https://json.nlohmann.me/api/basic_json_view/end/index.md) - the same iteration on a zero-copy view
|
||||
- [`basic_json_view::end`](https://json.nlohmann.me/api/basic_json_view/end/index.md) - the same iteration on a zero-copy view
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -161,8 +161,9 @@ Constant.
|
||||
|
||||
## See also
|
||||
|
||||
- [start_pos](start_pos.md) to access the start position
|
||||
- [JSON_DIAGNOSTIC_POSITIONS](../macros/json_diagnostic_positions.md) for an overview of the diagnostic positions
|
||||
- [`start_pos`](start_pos.md) - to access the start position
|
||||
- [`JSON_DIAGNOSTIC_POSITIONS`](../macros/json_diagnostic_positions.md) - overview of the supported conversions
|
||||
- [Parsing and Exceptions](../../features/parsing/parse_exceptions.md) - handling parse errors and locating them in the input
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -155,8 +155,9 @@ The output shows the start/end positions of all the objects and fields in the JS
|
||||
|
||||
## See also
|
||||
|
||||
- [start_pos](https://json.nlohmann.me/api/basic_json/start_pos/index.md) to access the start position
|
||||
- [JSON_DIAGNOSTIC_POSITIONS](https://json.nlohmann.me/api/macros/json_diagnostic_positions/index.md) for an overview of the diagnostic positions
|
||||
- [`start_pos`](https://json.nlohmann.me/api/basic_json/start_pos/index.md) - to access the start position
|
||||
- [`JSON_DIAGNOSTIC_POSITIONS`](https://json.nlohmann.me/api/macros/json_diagnostic_positions/index.md) - overview of the supported conversions
|
||||
- [Parsing and Exceptions](https://json.nlohmann.me/features/parsing/parse_exceptions/index.md) - handling parse errors and locating them in the input
|
||||
|
||||
## Version history
|
||||
|
||||
|
||||
@@ -337,8 +337,8 @@ Strong exception safety: if an exception occurs, the original value stays intact
|
||||
|
||||
## See also
|
||||
|
||||
- [clear](clear.md) clears the contents
|
||||
- [insert](insert.md) add values to an array/object
|
||||
- [`clear`](clear.md) - clears the contents
|
||||
- [`insert`](insert.md) - add values to an array/object
|
||||
- [Modifying values](../../features/modifying_values.md) - the article on modifying values
|
||||
|
||||
## Version history
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -300,8 +300,8 @@ Output:
|
||||
|
||||
## See also
|
||||
|
||||
- [clear](https://json.nlohmann.me/api/basic_json/clear/index.md) clears the contents
|
||||
- [insert](https://json.nlohmann.me/api/basic_json/insert/index.md) add values to an array/object
|
||||
- [`clear`](https://json.nlohmann.me/api/basic_json/clear/index.md) - clears the contents
|
||||
- [`insert`](https://json.nlohmann.me/api/basic_json/insert/index.md) - add values to an array/object
|
||||
- [Modifying values](https://json.nlohmann.me/features/modifying_values/index.md) - the article on modifying values
|
||||
|
||||
## Version history
|
||||
|
||||
@@ -90,7 +90,7 @@ keep
|
||||
|
||||
## See also
|
||||
|
||||
- [dump](dump.md) serializes a JSON value, with an `error_handler_t` parameter to configure invalid UTF-8 handling
|
||||
- [`dump`](dump.md) - serializes a JSON value, with an `error_handler_t` parameter to configure invalid UTF-8 handling
|
||||
- [Handling invalid UTF-8](../../features/serialization.md#handling-invalid-utf-8) - the article on handling invalid UTF-8
|
||||
|
||||
## Version history
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -70,7 +70,7 @@ string with the invalid byte kept as is (7 bytes, not valid UTF-8 itself)
|
||||
|
||||
## See also
|
||||
|
||||
- [dump](https://json.nlohmann.me/api/basic_json/dump/index.md) serializes a JSON value, with an `error_handler_t` parameter to configure invalid UTF-8 handling
|
||||
- [`dump`](https://json.nlohmann.me/api/basic_json/dump/index.md) - serializes a JSON value, with an `error_handler_t` parameter to configure invalid UTF-8 handling
|
||||
- [Handling invalid UTF-8](https://json.nlohmann.me/features/serialization/#handling-invalid-utf-8) - the article on handling invalid UTF-8
|
||||
|
||||
## Version history
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user