Loading...
Searching...
No Matches
meshkit::detail::Map< K, V >::Iterator< Const > Class Template Reference

Forward iterator over a Map whose dereference yields the mapped value. More...

#include <meshkit/detail/storage.hpp>

Collaboration diagram for meshkit::detail::Map< K, V >::Iterator< Const >:

Public Member Functions

 Iterator (It it)
 Wrap an underlying std::unordered_map iterator.
 
decltype(auto) value () const
 Mapped value at this position: V & for MutableIterator, const V & for ConstIterator.
 
const K & key () const
 Key at this position; must not be called on an end iterator.
 
decltype(auto) operator* () const
 Mapped value at this position, same as value().
 
auto operator-> () const
 Pointer to the mapped value (not to a key/value pair).
 
Iterator & operator++ ()
 Advance to the next entry.
 
bool operator== (const Iterator &b) const
 Position equality.
 
bool operator!= (const Iterator &b) const
 Position inequality.
 

Detailed Description

template<class K, class V>
template<bool Const>
class meshkit::detail::Map< K, V >::Iterator< Const >

Forward iterator over a Map whose dereference yields the mapped value.

Only prefix increment is provided.

Template Parameters
ConstTrue for read-only access (ConstIterator), false for MutableIterator.

Constructor & Destructor Documentation

◆ Iterator()

template<class K, class V>
template<bool Const>
meshkit::detail::Map< K, V >::Iterator< Const >::Iterator ( It it)
inlineexplicit

Wrap an underlying std::unordered_map iterator.

Parameters
[in]itPosition to wrap.

Member Function Documentation

◆ key()

template<class K, class V>
template<bool Const>
const K & meshkit::detail::Map< K, V >::Iterator< Const >::key ( ) const
inline

Key at this position; must not be called on an end iterator.

◆ operator!=()

template<class K, class V>
template<bool Const>
bool meshkit::detail::Map< K, V >::Iterator< Const >::operator!= ( const Iterator< Const > & b) const
inline

Position inequality.

Parameters
[in]bIterator into the same map.
Returns
True when the iterators are at different positions.

◆ operator*()

template<class K, class V>
template<bool Const>
decltype(auto) meshkit::detail::Map< K, V >::Iterator< Const >::operator* ( ) const
inline

Mapped value at this position, same as value().

◆ operator++()

template<class K, class V>
template<bool Const>
Iterator & meshkit::detail::Map< K, V >::Iterator< Const >::operator++ ( )
inline

Advance to the next entry.

Returns
Reference to this iterator.

◆ operator->()

template<class K, class V>
template<bool Const>
auto meshkit::detail::Map< K, V >::Iterator< Const >::operator-> ( ) const
inline

Pointer to the mapped value (not to a key/value pair).

◆ operator==()

template<class K, class V>
template<bool Const>
bool meshkit::detail::Map< K, V >::Iterator< Const >::operator== ( const Iterator< Const > & b) const
inline

Position equality.

Parameters
[in]bIterator into the same map.
Returns
True when both iterators are at the same position.

◆ value()

template<class K, class V>
template<bool Const>
decltype(auto) meshkit::detail::Map< K, V >::Iterator< Const >::value ( ) const
inline

Mapped value at this position: V & for MutableIterator, const V & for ConstIterator.

Must not be called on an end iterator.


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