xentara-utils v1.2.1
Xentara utilities library
Loading...
Searching...
No Matches
xentara::utils::json::decoder::Object::Iterator Class Referencefinal

#include <json/decoder/Object.hpp>

Public Types

using value_type = Member
 The value type.
 
using difference_type = std::ptrdiff_t
 Dummy type for non-existend difference type.
 
using reference = Member &
 A reference to a value.
 
using pointer = Member *
 A pointer to a value.
 
using iterator_concept = std::input_iterator_tag
 The iterator concept.
 
using iterator_category = iterator_concept
 The iterator category, for use in pre-C++20 code.
 

Public Member Functions

 Iterator () noexcept=default
 Default constructor.
 
 Iterator (std::default_sentinel_t) noexcept
 Conversion constructor for a sentinel.
 
auto operator== (const Iterator &rhs) const -> bool
 Equality operator.
 
auto operator++ () -> Iterator &
 Pre-increment operator.
 
auto operator++ (int) noexcept -> Iterator
 Post-increment operator.
 
auto operator* () noexcept -> reference
 Indirection operator.
 
auto operator-> () noexcept -> pointer
 Member access operator.
 

Member Typedef Documentation

◆ difference_type

Dummy type for non-existend difference type.

◆ iterator_category

The iterator category, for use in pre-C++20 code.

◆ iterator_concept

◆ pointer

◆ reference

◆ value_type

Constructor & Destructor Documentation

◆ Iterator() [1/2]

xentara::utils::json::decoder::Object::Iterator::Iterator ( )
defaultnoexcept

Default constructor.

This constructor creates an invalid iterator. It is suitable as a sentinel for algorithms that require the sentinel to be of the same type as the iterator.

◆ Iterator() [2/2]

xentara::utils::json::decoder::Object::Iterator::Iterator ( std::default_sentinel_t  )
noexcept

Conversion constructor for a sentinel.

This constructor creates an invalid iterator suitable for use as a sentinel for algorithms that require the sentinel to be of the same type as the iterator.

Member Function Documentation

◆ operator*()

auto xentara::utils::json::decoder::Object::Iterator::operator* ( ) -> reference
noexcept

Indirection operator.

Attention
Must not be called on the past-the-end iterator.
Returns
A reference to the member at the current position.

◆ operator++() [1/2]

auto xentara::utils::json::decoder::Object::Iterator::operator++ ( ) -> Iterator &

Pre-increment operator.

Moves the iterator forward by one position.

Attention
Must not be called on the past-the-end iterator.

◆ operator++() [2/2]

auto xentara::utils::json::decoder::Object::Iterator::operator++ ( int  ) -> Iterator
noexcept

Post-increment operator.

Moves the iterator forward by one position.

Attention
Must not be called on the past-the-end iterator.
Returns
An iterator containing the member pointed to before the call

◆ operator->()

auto xentara::utils::json::decoder::Object::Iterator::operator-> ( ) -> pointer
noexcept

Member access operator.

Gives access to a class member of the object member at the current position.

Attention
Must not be called on the past-the-end iterator.

◆ operator==()

auto xentara::utils::json::decoder::Object::Iterator::operator== ( const Iterator rhs) const -> bool

Equality operator.

This operator is intended to be used to check for the end of an object in algorithms that do not support std::default_sentinel_t, but use an invalid iterator as sentinel instead.

This method does not check the position of the iterator within the array. Any valid iterator will compare equal to any other valid iterator for the same array. An iterator that has gone past the end of the object will compare equal to a default constructed iterator, or an iterator that was constructed from std::default_sentinel.