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

Read-only forward cursor. More...

#include <StormByte/safe/unordered_set.hxx>

Public Types

using iterator_category = std::forward_iterator_tag
 Iterator category.
using iterator_concept = std::forward_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 value.
using reference = const K&
 Reference to the value.
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 value.
pointer operator-> () const
 Return a pointer to the value.
const_iterator & operator++ ()
 Advance to the next occupied node.
const_iterator operator++ (int)
 Advance to the next occupied node.
bool operator== (const const_iterator &other) const noexcept
 Compare node identity.

Friends

class UnorderedSet

Detailed Description

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
class StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator

Read-only forward cursor.

Member Typedef Documentation

◆ difference_type

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
using StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator::difference_type = std::ptrdiff_t

Iterator distance type.

◆ iterator_category

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
using StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator::iterator_category = std::forward_iterator_tag

Iterator category.

◆ iterator_concept

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
using StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator::iterator_concept = std::forward_iterator_tag

C++20 iterator concept.

◆ pointer

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
using StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator::pointer = const K*

Pointer to the value.

◆ reference

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
using StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator::reference = const K&

Reference to the value.

◆ StormByteSafeCursor

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
using StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator::StormByteSafeCursor = void

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

◆ value_type

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
using StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator::value_type = K

Stored value.

Constructor & Destructor Documentation

◆ const_iterator() [1/2]

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator::const_iterator ( )
defaultnoexcept

Construct a singular iterator.

◆ const_iterator() [2/2]

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator::const_iterator ( iterator other)
inlinenoexcept

Construct from a mutable iterator.

Parameters
otherMutable cursor.

Member Function Documentation

◆ operator*()

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
reference StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator::operator* ( ) const
inline

Return the value.

Returns
Value. Valid until the node is erased or the set is rehashed.

◆ operator++() [1/2]

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
const_iterator & StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator::operator++ ( )
inline

Advance to the next occupied node.

Returns
This iterator.

◆ operator++() [2/2]

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
const_iterator StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator::operator++ ( int )
inline

Advance to the next occupied node.

Returns
The previous position.

◆ operator->()

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
pointer StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator::operator-> ( ) const
inline

Return a pointer to the value.

Returns
Value pointer.

◆ operator==()

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
bool StormByte::Safe::UnorderedSet< K, Hash, KeyEqual >::const_iterator::operator== ( const const_iterator & other) const
inlinenoexcept

Compare node identity.

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

◆ UnorderedSet

template<Type::SafeValue K, class Hash = Hash<K>, class KeyEqual = std::equal_to<K>>
friend class UnorderedSet
friend

The documentation for this class was generated from the following file: