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

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

 iterator () noexcept=default
 Construct a singular iterator.
reference operator* () const
 Return the key.
pointer operator-> () const
 Return a pointer to the key.
iterator & operator++ ()
 Advance to the next key.
iterator operator++ (int)
 Advance to the next key.
iterator & operator-- ()
 Move to the previous key.
iterator operator-- (int)
 Move to the previous key.
bool operator== (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 >::iterator

Bidirectional cursor.

Dereference is the key.

Member Typedef Documentation

◆ difference_type

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::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 >::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 >::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 >::iterator::pointer = const K*

Pointer to the key.

◆ reference

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

Reference to the key.

◆ StormByteSafeCursor

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::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 >::iterator::value_type = K

Stored value.

Constructor & Destructor Documentation

◆ iterator()

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

Construct a singular iterator.

Member Function Documentation

◆ operator*()

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

Return the key.

Returns
Key. Valid while the node stays linked.

◆ operator++() [1/2]

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

Advance to the next key.

Returns
This iterator.

◆ operator++() [2/2]

template<Type::SafeValue K, class Compare = std::less<K>>
iterator StormByte::Safe::Set< K, Compare >::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>>
iterator & StormByte::Safe::Set< K, Compare >::iterator::operator-- ( )
inline

Move to the previous key.

Returns
This iterator.

◆ operator--() [2/2]

template<Type::SafeValue K, class Compare = std::less<K>>
iterator StormByte::Safe::Set< K, Compare >::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 >::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 >::iterator::operator== ( 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