Qx v0.6
Qt Extensions Library
|
The Lopmap::const_iterator class provides an STL-style const iterator for Lopmap. More...
#include <qx/core/qx-lopmap.h>
Public Types | |
using | iterator_category = typename StorageItr::iterator_category |
Public Member Functions | |
const_iterator () | |
const Key & | key () const |
const T & | operator* () const |
const_iterator & | operator++ () |
const_iterator | operator++ (int) |
const_iterator & | operator-- () |
const_iterator | operator-- (int) |
const T * | operator-> () const |
bool | operator== (const const_iterator &other) const =default |
const T & | value () const |
Friends | |
class | Lopmap< Key, T, Compare > |
Lopmap<Key, T, Compare>::const_iterator allows you to iterate over a Lopmap.
The default Lopmap::const_iterator constructor creates an uninitialized iterator. You must initialize it using a Lopmap function like Lopmap::cbegin(), Lopmap::cend(), or Lopmap::constFind() before you can start iterating.
Lopmap stores its items ordered according to Compare.
Multiple iterators can be used on the same map. If you add items to the map, existing iterators will remain valid. If you remove items from the map, iterators that point to the removed items will become dangling iterators.
Inserting relationships into the lopmap or calling methods such as Lopmap::reserve() or Lopmap::squeeze() can invalidate all iterators pointing into the lopmap. Iterators are guaranteed to stay valid only as long as the Lopmap doesn't have to grow/shrink its internal table. Using any iterator after a rehashing operation has occurred will lead to undefined behavior
Qx::Lopmap< Key, T, Compare >::const_iterator::iterator_category = typename StorageItr::iterator_category |
A synonym for std::bidirectional_iterator_tag indicating this iterator is a bidirectional iterator.
|
inline |
Constructs an uninitialized iterator.
Functions like key(), value(), and operator++() must not be called on an uninitialized iterator. Use operator=() to assign a value to it before using it.
|
inline |
Returns the current item's key.
|
inline |
Returns the current item's value.
|
inline |
The prefix ++
operator (++i) advances the iterator to the next item in the lopmap and returns an iterator to the new item relationship.
Calling this function on Lopmap::constEnd() leads to undefined results.
|
inline |
The postfix ++
operator (i++) advances the iterator to the next item in the lopmap and returns an iterator to the previously current item.
Calling this function on Lopmap::constEnd() leads to undefined results.
|
inline |
The prefix --
operator (--i) makes the preceding item current and returns an iterator to the new current item.
Calling this function on Lopmap::constBegin() leads to undefined results.
|
inline |
The postfix --
operator (--i) makes the preceding item current and returns an iterator to the previously current item.
Calling this function on Lopmap::constEnd() leads to undefined results.
|
inline |
Returns a pointer to the current item's value.
|
default |
Returns true
if other points to the same item as this iterator; otherwise, returns false
.
|
inline |
Returns the current item's value.