ROSE  0.11.145.0
Public Types | Public Member Functions | List of all members
Sawyer::Container::DenseIntegerSet< T >::ConstIterator Class Reference

Description

template<typename T>
class Sawyer::Container::DenseIntegerSet< T >::ConstIterator

Bidirectional iterates over members of a set.

This iterator iterates over the values that are currently members of a set. A set is able to return a begin and end iterator in constant time, and the iterator's increment and dereference operators are constant time. These iterators return const references since the container does not support modifying existing members through an iterator. When compiled in debugging mode, these iterators also include various assertions about their validity.

DenseIntegerSet iterators are stable over insert and erase; inserting and erasing members of the iterated set does not invalidate existing iterators except in the case of iterators that are pointing to an erased member. However, although using an iterator as a pointer is safe, iterating over a set that's being modified at the same time is generally not supported–there is no guarantee that iterations will reach all members in these cases. The erase-at-iterator method returns an iterator in order to guarantee that the iterator used for erasing does indeed reach all members.

Definition at line 156 of file DenseIntegerSet.h.

#include <util/Sawyer/DenseIntegerSet.h>

Public Types

using iterator_category = std::output_iterator_tag
 
using value_type = const Value
 
using difference_type = std::ptrdiff_t
 
using pointer = const Value *
 
using reference = const Value &
 

Public Member Functions

bool operator== (const ConstIterator &other) const
 Iterators are comparable for equality. More...
 
bool operator!= (const ConstIterator &other) const
 Iterators are comparable for inequality. More...
 
bool operator< (const ConstIterator &other) const
 Iterators are less-than comparable. More...
 
const Valueoperator* () const
 Dereference. More...
 
ConstIteratoroperator++ ()
 Increment. More...
 
ConstIterator operator++ (int)
 Increment. More...
 
ConstIteratoroperator-- ()
 Decrement. More...
 
ConstIteratoroperator-- (int)
 Decrement. More...
 

Member Function Documentation

template<typename T>
bool Sawyer::Container::DenseIntegerSet< T >::ConstIterator::operator== ( const ConstIterator other) const
inline

Iterators are comparable for equality.

Two iterators are equal if and only if they point to the same member of the same set or they are both end iterators of the same set.

Definition at line 180 of file DenseIntegerSet.h.

template<typename T>
bool Sawyer::Container::DenseIntegerSet< T >::ConstIterator::operator!= ( const ConstIterator other) const
inline

Iterators are comparable for inequality.

Two iterators are unequal if they do not satisfy the equality predicate.

Definition at line 187 of file DenseIntegerSet.h.

template<typename T>
bool Sawyer::Container::DenseIntegerSet< T >::ConstIterator::operator< ( const ConstIterator other) const
inline

Iterators are less-than comparable.

The exact meaning of less-than is undefined, but it satisfies the requirements of a less-than operator. Namely,

  • if two iterators are equal then neither is less than the other.
  • if two iterators are unequal, then exactly one is less than the other.
  • non-symmetric: if A is less than B then B is not less than A.
  • transitive: if A is less than B and B is less than C then A is less than C.

This property allows iterators to be used as keys in containers that order their keys.

Definition at line 201 of file DenseIntegerSet.h.

template<typename T>
ConstIterator& Sawyer::Container::DenseIntegerSet< T >::ConstIterator::operator++ ( )
inline

Increment.

Causes this iterator to point to the next member. The members of a set have no particular order. Incrementing the end iterator has undefined behavior. Incrementing is a constant-time operation.

Definition at line 213 of file DenseIntegerSet.h.

template<typename T>
ConstIterator Sawyer::Container::DenseIntegerSet< T >::ConstIterator::operator++ ( int  )
inline

Increment.

Causes this iterator to point to the next member. The members of a set have no particular order. Incrementing the end iterator has undefined behavior. Incrementing is a constant-time operation.

Definition at line 217 of file DenseIntegerSet.h.

template<typename T>
ConstIterator& Sawyer::Container::DenseIntegerSet< T >::ConstIterator::operator-- ( )
inline

Decrement.

Causes this iterator to point to the previous member. The members of a set have no particular order. Decrementing the begin iterator has undefined behavior. Decrementing is a constant-time operation.

Definition at line 230 of file DenseIntegerSet.h.

template<typename T>
ConstIterator& Sawyer::Container::DenseIntegerSet< T >::ConstIterator::operator-- ( int  )
inline

Decrement.

Causes this iterator to point to the previous member. The members of a set have no particular order. Decrementing the begin iterator has undefined behavior. Decrementing is a constant-time operation.

Definition at line 235 of file DenseIntegerSet.h.

template<typename T>
const Value& Sawyer::Container::DenseIntegerSet< T >::ConstIterator::operator* ( ) const
inline

Dereference.

Returns the value to which the iterator points. Dereferencing the end iterator has undefined behavior. Dereferencing is a constant-time operation.

Definition at line 246 of file DenseIntegerSet.h.


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