StormByte 3.0.0
C++26 foundation of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Safe::Set< K, Compare >::const_iterator Class Reference

Read-only bidirectional cursor. More...

#include <StormByte/safe/set.hxx>

Public Types

using iterator_category = std::bidirectional_iterator_tag
 Iterator category.
using iterator_concept = std::bidirectional_iterator_tag
 C++20 iterator concept.
using value_type = K
 Stored value.
using difference_type = std::ptrdiff_t
 Iterator distance type.
using pointer = const K*
 Pointer to the key.
using reference = const K&
 Reference to the key.
using StormByteSafeCursor = void
 Base cursor mark. Copying the cursor copies one node pointer.

Public Member Functions

 const_iterator () noexcept=default
 Construct a singular iterator.
 const_iterator (iterator other) noexcept
 Construct from a mutable iterator.
reference operator* () const
 Return the key.
pointer operator-> () const
 Return a pointer to the key.
const_iterator & operator++ ()
 Advance to the next key.
const_iterator operator++ (int)
 Advance to the next key.
const_iterator & operator-- ()
 Move to the previous key.
const_iterator operator-- (int)
 Move to the previous key.
bool operator== (const const_iterator &other) const noexcept
 Compare node identity.

Friends

class Set

Detailed Description

template<Type::SafeValue K, class Compare = std::less<K>>
class StormByte::Safe::Set< K, Compare >::const_iterator

Read-only bidirectional cursor.

Member Typedef Documentation

◆ difference_type

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::const_iterator::difference_type = std::ptrdiff_t

Iterator distance type.

◆ iterator_category

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::const_iterator::iterator_category = std::bidirectional_iterator_tag

Iterator category.

◆ iterator_concept

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::const_iterator::iterator_concept = std::bidirectional_iterator_tag

C++20 iterator concept.

◆ pointer

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::const_iterator::pointer = const K*

Pointer to the key.

◆ reference

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::const_iterator::reference = const K&

Reference to the key.

◆ StormByteSafeCursor

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::const_iterator::StormByteSafeCursor = void

Base cursor mark. Copying the cursor copies one node pointer.

◆ value_type

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::const_iterator::value_type = K

Stored value.

Constructor & Destructor Documentation

◆ const_iterator() [1/2]

template<Type::SafeValue K, class Compare = std::less<K>>
StormByte::Safe::Set< K, Compare >::const_iterator::const_iterator ( )
defaultnoexcept

Construct a singular iterator.

◆ const_iterator() [2/2]

template<Type::SafeValue K, class Compare = std::less<K>>
StormByte::Safe::Set< K, Compare >::const_iterator::const_iterator ( iterator other)
inlinenoexcept

Construct from a mutable iterator.

Parameters
otherMutable cursor.

Member Function Documentation

◆ operator*()

template<Type::SafeValue K, class Compare = std::less<K>>
reference StormByte::Safe::Set< K, Compare >::const_iterator::operator* ( ) const
inline

Return the key.

Returns
Key.

◆ operator++() [1/2]

template<Type::SafeValue K, class Compare = std::less<K>>
const_iterator & StormByte::Safe::Set< K, Compare >::const_iterator::operator++ ( )
inline

Advance to the next key.

Returns
This iterator.

◆ operator++() [2/2]

template<Type::SafeValue K, class Compare = std::less<K>>
const_iterator StormByte::Safe::Set< K, Compare >::const_iterator::operator++ ( int )
inline

Advance to the next key.

Returns
The previous position.

◆ operator--() [1/2]

template<Type::SafeValue K, class Compare = std::less<K>>
const_iterator & StormByte::Safe::Set< K, Compare >::const_iterator::operator-- ( )
inline

Move to the previous key.

Returns
This iterator.

◆ operator--() [2/2]

template<Type::SafeValue K, class Compare = std::less<K>>
const_iterator StormByte::Safe::Set< K, Compare >::const_iterator::operator-- ( int )
inline

Move to the previous key.

Returns
The previous position.

◆ operator->()

template<Type::SafeValue K, class Compare = std::less<K>>
pointer StormByte::Safe::Set< K, Compare >::const_iterator::operator-> ( ) const
inline

Return a pointer to the key.

Returns
Key pointer.

◆ operator==()

template<Type::SafeValue K, class Compare = std::less<K>>
bool StormByte::Safe::Set< K, Compare >::const_iterator::operator== ( const const_iterator & other) const
inlinenoexcept

Compare node identity.

Parameters
otherIterator to compare.
Returns
Whether both designate the same node.

◆ Set

template<Type::SafeValue K, class Compare = std::less<K>>
friend class Set
friend

The documentation for this class was generated from the following file:
  • lib/public/StormByte/safe/set.hxx