![]() |
CopperSpice API
2.0.0
|
STL style const iterator for QFlatMap. More...
Public Typedefs | |
using | iterator_category = std::bidirectional_iterator_tag |
Public Methods | |
const_iterator () = default | |
const_iterator (iterator iter) | |
const Key & | key () const |
bool | operator!= (const_iterator other) const |
const Val & | operator* () const |
const_iterator | operator+ (size_type n) const |
const_iterator & | operator++ () |
const_iterator | operator++ (int) |
const_iterator & | operator+= (size_type n) |
const_iterator | operator- (size_type n) const |
const_iterator & | operator-- () |
const_iterator | operator-- (int) |
const_iterator & | operator-= (size_type n) |
const Val * | operator-> () const |
bool | operator== (const_iterator other) const |
const std::pair< Key, Val > & | pair () const |
const Val & | value () const |
Friends | |
class | QFlatMap< Key, Val, C > |
The QFlatMap::const_iterator class provides an STL style const iterator for QFlatMap. QFlatMap features both STL style iterators and Java style iterators.
QFlatMap::const_iterator allows you to iterate over a QFlatMap. If you want to modify the QFlatMap as you iterate over it use QFlatMap::iterator instead.
After construction you must initialize the iterator using a method like QFlatMap::constBegin(), QFlatMap::constEnd(), or QFlatMap::find() before you can start iterating.
The following example prints all of the (key, value) pairs stored in the flat map.
QFlatMap< Key, Val, C >::const_iterator::iterator_category |
Equivalent to std::bidirectional_iterator_tag indicating this iterator is a bidirectional iterator.
|
default |
Constructs an uninitialized iterator.
Methods 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 |
Constructs a copy of iter.
|
inline |
Returns the current item's key.
|
inline |
Returns true if other points to a different item than this iterator, otherwise it returns false.
|
inline |
|
inline |
Returns an iterator to the item at n positions forward from this iterator. If n is negative the iterator goes backward.
This operation can be slow for large values of n.
|
inline |
The prefix ++
operator advances the iterator to the next item in the flat map and returns an iterator to the new current item.
Calling this method on QFlatMap::cend() causes undefined behavior.
|
inline |
The postfix ++
operator advances the iterator to the next item in the flat map and returns an iterator to the previous current item.
Calling this method on QFlatMap::cend() causes undefined behavior.
|
inline |
Advances the iterator by n items. If n is negative the iterator goes backward.
This operation can be slow for large values of n.
|
inline |
Returns an iterator to the item at n positions backward from this iterator. If n is negative the iterator goes forward.
This operation can be slow for large values of n.
|
inline |
The prefix --
operator decrements the iterator to the previous item in the flat map and returns an iterator to the new current item.
Calling this method on QFlatMap::cbegin() causes undefined behavior.
|
inline |
The postfix --
operator decrements the iterator to the previous item in the flat map and returns an iterator to the previous current item.
Calling this method on QFlatMap::cbegin() causes undefined behavior.
|
inline |
Makes the iterator go back by n items. If n is negative the iterator goes forward. This operation can be slow for large values of n.
|
inline |
Returns a pointer to the current item's value.
|
inline |
Returns true if other points to the same item as this iterator, otherwise it returns false.
|
inline |
Returns a pair consisting of the key and the value.
|
inline |
Returns the current item's value.