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

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

Public Typedefs

using iterator_category = std::forward_iterator_tag
 

Public Methods

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

Detailed Description

template<class T>
class QSet< T >::iterator

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

See also
QSet::begin(), QSet::end(), QSet::const_iterator

Member Typedef Documentation

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

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

Constructor & Destructor Documentation

template<class T >
QSet< T >::iterator::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 >::iterator::iterator ( const iterator other)

Constructs a copy of other.

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

Move constructs a new QSet::iterator from other.

Method Documentation

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

Returns a reference to the current item.

See also
operator->()
template<class T >
iterator QSet< T >::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 >
iterator & QSet< T >::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 >
iterator QSet< T >::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 >
iterator & QSet< T >::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 >::iterator::operator-> ( ) const

Returns a pointer to the current item.

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

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

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

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

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

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