CopperSpice API  1.7.2
QSet< T >::const_iterator Class Reference

Provides an STL style const iterator for QSet. More...

Public Typedefs

using iterator_category = std::forward_iterator_tag
 

Public Methods

 const_iterator ()
 
 const_iterator (const const_iterator &other)
 
 const_iterator (const iterator &other)
 
 const_iterator (const_iterator &&other)
 
 const_iterator (iterator &&other)
 
const T & operator* () const
 
const_iterator operator+ (size_type n) const
 
const_iteratoroperator++ ()
 
const_iterator operator++ (int)
 
const_iteratoroperator+= (size_type n)
 
const T * operator-> () const
 
const_iteratoroperator= (const const_iterator &other)
 
const_iteratoroperator= (const iterator &other)
 
const_iteratoroperator= (const_iterator &&other)
 
const_iteratoroperator= (iterator &&other)
 
bool operator== (const_iterator other) const
 

Detailed Description

template<class T>
class QSet< T >::const_iterator

The QSet::const_iterator class provides an STL style const iterator for QSet.

See also
QSet::constBegin(), QSet::constEnd(), QSet::iterator

Member Typedef Documentation

template<class T >
QSet< T >::const_iterator::iterator_category

Synonyms for std::bidirectional_iterator_tag indicating these iterators are bidirectional iterators.

Constructor & Destructor Documentation

template<class T >
QSet< T >::const_iterator::const_iterator ( )

Constructs an uninitialized iterator.

Functions like operator*() and operator++() should not be called on an uninitialized iterator. Use operator=() to assign a value to it before using it.

See also
QSet::begin(), QSet::end()
template<class T >
QSet< T >::const_iterator::const_iterator ( const const_iterator other)

Constructs a copy of other.

template<class T >
QSet< T >::const_iterator::const_iterator ( const iterator other)

Copy constructs a new QSet::const_iterator from other.

template<class T >
QSet< T >::const_iterator::const_iterator ( const_iterator &&  other)

Move constructs a new QSet::const_iterator from other.

template<class T >
QSet< T >::const_iterator::const_iterator ( iterator &&  other)

Move constructs a new QSet::const_iterator from other.

Method Documentation

template<class T >
const T & QSet< T >::const_iterator::operator* ( ) const

Returns a reference to the current item.

See also
operator->()
template<class T >
const_iterator QSet< T >::const_iterator::operator+ ( size_type  n) const

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.

See also
operator-()
template<class T >
const_iterator & QSet< T >::const_iterator::operator++ ( )

The prefix ++ operator (++it) advances the iterator to the next item in the set and returns an iterator to the new current item.

Calling this function on QSet::constEnd() leads to undefined behavior.

See also
operator--()
template<class T >
const_iterator QSet< T >::const_iterator::operator++ ( int  )

The postfix ++ operator (it++) advances the iterator to the next item in the set and returns an iterator to the previously current item.

template<class T >
const_iterator & QSet< T >::const_iterator::operator+= ( size_type  n)

Advances the iterator by n items. If n is negative the iterator goes backward.

This operation can be slow for large values of n.

See also
operator-=(), operator+()
template<class T >
const T * QSet< T >::const_iterator::operator-> ( ) const

Returns a pointer to the current item.

See also
operator*()
template<class T >
const_iterator & QSet< T >::const_iterator::operator= ( const const_iterator other)

Copy assigns from other and returns a reference to this object.

template<class T >
const_iterator & QSet< T >::const_iterator::operator= ( const iterator other)

Copy assigns from other and returns a reference to this object.

template<class T >
const_iterator & QSet< T >::const_iterator::operator= ( const_iterator &&  other)

Move assigns from other and returns a reference to this object.

template<class T >
const_iterator & QSet< T >::const_iterator::operator= ( iterator &&  other)

Move assigns from other and returns a reference to this object.

template<class T >
bool QSet< T >::const_iterator::operator== ( const_iterator  other) const

Returns true if other points to the same item as this iterator, otherwise returns false.

See also
operator!=()