mirror of
https://github.com/nlohmann/json.git
synced 2026-10-27 00:08:55 +00:00
Add See also links in both directions between the concept pages (features, home, integration) and the API pages, write API links in code font, give every entry a comment after a dash, and show the callback event figure on the parser callbacks page. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
1.2 KiB
1.2 KiB
nlohmann::basic_json::end
iterator end() noexcept;
const_iterator end() const noexcept;
Returns an iterator to one past the last element.
--8<-- "images/range-begin-end.svg"
`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
Exception safety
No-throw guarantee: this member function never throws exceptions.
Complexity
Constant.
Examples
??? example
The following code shows an example for `end()`.
```cpp
--8<-- "examples/end.cpp"
```
Output:
```json
--8<-- "examples/end.output"
```
See also
begin- returns an iterator to the first elementcend- returns a const iterator to one past the last elementrend- returns a reverse iterator to one before the first element- Iterators - the article on iterators
basic_json_view::end- the same iteration on a zero-copy view
Version history
- Added in version 1.0.0.