libhatchet
Loading...
Searching...
No Matches
hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator Class Reference

#include <hxflat_map.hpp>

Public Member Functions

 const_iterator (void)
const const_iteratoroperator* (void) const
const_iteratoroperator+= (hxsize_t n_)
const_iteratoroperator-= (hxsize_t n_)
const_iterator operator+ (hxsize_t n_) const
const_iterator operator- (hxsize_t n_) const
hxsize_t operator- (const const_iterator &x_) const
const_iterator operator[] (hxsize_t n_) const
const_iteratoroperator++ (void)
const_iterator operator++ (int)
const_iteratoroperator-- (void)
const_iterator operator-- (int)
bool operator== (const const_iterator &x_) const
bool operator< (const const_iterator &x_) const
bool operator> (const const_iterator &x_) const
bool operator<= (const const_iterator &x_) const
bool operator>= (const const_iterator &x_) const
const key_t_ & key (void) const
const mapped_t_ & value (void) const

Detailed Description

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
class hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator

const_iterator - A random-access iterator over key-value pairs.

Iterators are invalidated by any insert or erase operation. Dereference via operator* returns a const const_iterator& so callers can use key() and value().

Constructor & Destructor Documentation

◆ const_iterator()

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::const_iterator ( void )
inline

Constructs an end iterator.

Member Function Documentation

◆ key()

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const key_t_ & hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::key ( void ) const

Returns the key at the current position.

This is simple so the compiler errors are simple.

◆ operator*()

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const const_iterator & hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator* ( void ) const
inline

Returns a const reference to this iterator, allowing use as a proxy element.

Access key and value via key() and value(). This is non-standard.

◆ operator+()

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const_iterator hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator+ ( hxsize_t n_) const
inline

Returns an iterator advanced by n positions.

  • n : The number of positions to advance.

◆ operator++() [1/2]

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const_iterator hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator++ ( int )
inline

Advances the iterator to the next element (post-increment).

◆ operator++() [2/2]

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const_iterator & hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator++ ( void )
inline

Advances the iterator to the next element.

◆ operator+=()

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const_iterator & hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator+= ( hxsize_t n_)

Advances the iterator by n positions.

  • n : The number of positions to advance.

◆ operator-() [1/2]

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
hxsize_t hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator- ( const const_iterator & x_) const

Returns the signed distance between two iterators.

  • x : The iterator to subtract.

◆ operator-() [2/2]

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const_iterator hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator- ( hxsize_t n_) const
inline

Returns an iterator retreated by n positions.

  • n : The number of positions to retreat.

◆ operator--() [1/2]

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const_iterator hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator-- ( int )
inline

Retreats the iterator to the previous element (post-decrement).

◆ operator--() [2/2]

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const_iterator & hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator-- ( void )
inline

Retreats the iterator to the previous element.

◆ operator-=()

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const_iterator & hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator-= ( hxsize_t n_)
inline

Moves the iterator back by n positions.

  • n : The number of positions to retreat.

◆ operator<()

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
bool hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator< ( const const_iterator & x_) const

Returns true when this iterator is ordered before x.

  • x : The iterator to compare against.

◆ operator<=()

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
bool hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator<= ( const const_iterator & x_) const
inline

Returns true when this iterator is not ordered after x.

  • x : The iterator to compare against.

◆ operator==()

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
bool hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator== ( const const_iterator & x_) const

Compares two iterators for equality.

  • x : The iterator to compare against.

◆ operator>()

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
bool hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator> ( const const_iterator & x_) const
inline

Returns true when this iterator is ordered after x.

  • x : The iterator to compare against.

◆ operator>=()

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
bool hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator>= ( const const_iterator & x_) const
inline

Returns true when this iterator is not ordered before x.

  • x : The iterator to compare against.

◆ operator[]()

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const_iterator hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::operator[] ( hxsize_t n_) const
inline

Returns a copy of the iterator offset by n positions.

  • n : The offset from this position.

◆ value()

template<typename key_t_, typename mapped_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const mapped_t_ & hxflat_map< key_t_, mapped_t_, compare_t_, multi_t_, capacity_ >::const_iterator::value ( void ) const

Returns the mapped value at the current position.

This is simple so the compiler errors are simple.


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