Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
util::IntegerRangeIterator< IntegerType > Class Template Reference

Detailed Description

template<typename IntegerType>
class util::IntegerRangeIterator< IntegerType >

Simple iterator on an integer range, see IntegerRange below. IntegerType can be any signed integer type, or strong integer type that defines usual operations (e.g. gtl::IntType<T>).

Todo
(b/385094969): In C++17, std::iterator_traits<Iterator> required explicitly specifying the iterator category. Remove this when backwards compatibility with C++17 is no longer needed.

Definition at line 123 of file iterators.h.

#include <iterators.h>

Inheritance diagram for util::IntegerRangeIterator< IntegerType >:

Public Types

using difference_type = ptrdiff_t
using value_type = IntegerType

Public Member Functions

 IntegerRangeIterator ()
 IntegerRangeIterator (IntegerType value)
IntegerType operator* () const
bool operator== (const IntegerRangeIterator &other) const
bool operator!= (const IntegerRangeIterator &other) const
bool operator< (const IntegerRangeIterator &other) const
bool operator> (const IntegerRangeIterator &other) const
bool operator<= (const IntegerRangeIterator &other) const
bool operator>= (const IntegerRangeIterator &other) const
IntegerRangeIteratoroperator++ ()
IntegerRangeIterator operator++ (int)
IntegerRangeIteratoroperator+= (difference_type n)
IntegerRangeIteratoroperator-- ()
IntegerRangeIterator operator-- (int)
IntegerRangeIteratoroperator-= (difference_type n)
IntegerType operator[] (difference_type n) const

Friends

IntegerRangeIterator operator+ (IntegerRangeIterator it, difference_type n)
IntegerRangeIterator operator+ (difference_type n, IntegerRangeIterator it)
IntegerRangeIterator operator- (IntegerRangeIterator it, difference_type n)
difference_type operator- (const IntegerRangeIterator l, const IntegerRangeIterator r)

Member Typedef Documentation

◆ difference_type

template<typename IntegerType>
using util::IntegerRangeIterator< IntegerType >::difference_type = ptrdiff_t

Definition at line 132 of file iterators.h.

◆ value_type

template<typename IntegerType>
using util::IntegerRangeIterator< IntegerType >::value_type = IntegerType

Definition at line 133 of file iterators.h.

Constructor & Destructor Documentation

◆ IntegerRangeIterator() [1/2]

template<typename IntegerType>
util::IntegerRangeIterator< IntegerType >::IntegerRangeIterator ( )
inline

Definition at line 140 of file iterators.h.

◆ IntegerRangeIterator() [2/2]

template<typename IntegerType>
util::IntegerRangeIterator< IntegerType >::IntegerRangeIterator ( IntegerType value)
inlineexplicit

Definition at line 142 of file iterators.h.

Member Function Documentation

◆ operator!=()

template<typename IntegerType>
bool util::IntegerRangeIterator< IntegerType >::operator!= ( const IntegerRangeIterator< IntegerType > & other) const
inline

Definition at line 151 of file iterators.h.

◆ operator*()

template<typename IntegerType>
IntegerType util::IntegerRangeIterator< IntegerType >::operator* ( ) const
inline

Definition at line 144 of file iterators.h.

◆ operator++() [1/2]

template<typename IntegerType>
IntegerRangeIterator & util::IntegerRangeIterator< IntegerType >::operator++ ( )
inline

Definition at line 167 of file iterators.h.

◆ operator++() [2/2]

template<typename IntegerType>
IntegerRangeIterator util::IntegerRangeIterator< IntegerType >::operator++ ( int )
inline

Definition at line 172 of file iterators.h.

◆ operator+=()

template<typename IntegerType>
IntegerRangeIterator & util::IntegerRangeIterator< IntegerType >::operator+= ( difference_type n)
inline

Definition at line 178 of file iterators.h.

◆ operator--() [1/2]

template<typename IntegerType>
IntegerRangeIterator & util::IntegerRangeIterator< IntegerType >::operator-- ( )
inline

Definition at line 183 of file iterators.h.

◆ operator--() [2/2]

template<typename IntegerType>
IntegerRangeIterator util::IntegerRangeIterator< IntegerType >::operator-- ( int )
inline

Definition at line 188 of file iterators.h.

◆ operator-=()

template<typename IntegerType>
IntegerRangeIterator & util::IntegerRangeIterator< IntegerType >::operator-= ( difference_type n)
inline

Definition at line 194 of file iterators.h.

◆ operator<()

template<typename IntegerType>
bool util::IntegerRangeIterator< IntegerType >::operator< ( const IntegerRangeIterator< IntegerType > & other) const
inline

Definition at line 154 of file iterators.h.

◆ operator<=()

template<typename IntegerType>
bool util::IntegerRangeIterator< IntegerType >::operator<= ( const IntegerRangeIterator< IntegerType > & other) const
inline

Definition at line 160 of file iterators.h.

◆ operator==()

template<typename IntegerType>
bool util::IntegerRangeIterator< IntegerType >::operator== ( const IntegerRangeIterator< IntegerType > & other) const
inline
Todo
(b/385094969): Use =default when backwards compatibility with C++17 is no longer needed.

Definition at line 148 of file iterators.h.

◆ operator>()

template<typename IntegerType>
bool util::IntegerRangeIterator< IntegerType >::operator> ( const IntegerRangeIterator< IntegerType > & other) const
inline

Definition at line 157 of file iterators.h.

◆ operator>=()

template<typename IntegerType>
bool util::IntegerRangeIterator< IntegerType >::operator>= ( const IntegerRangeIterator< IntegerType > & other) const
inline

Definition at line 163 of file iterators.h.

◆ operator[]()

template<typename IntegerType>
IntegerType util::IntegerRangeIterator< IntegerType >::operator[] ( difference_type n) const
inline

Definition at line 199 of file iterators.h.

◆ operator+ [1/2]

template<typename IntegerType>
IntegerRangeIterator operator+ ( difference_type n,
IntegerRangeIterator< IntegerType > it )
friend

Definition at line 206 of file iterators.h.

◆ operator+ [2/2]

template<typename IntegerType>
IntegerRangeIterator operator+ ( IntegerRangeIterator< IntegerType > it,
difference_type n )
friend

Definition at line 201 of file iterators.h.

◆ operator- [1/2]

template<typename IntegerType>
difference_type operator- ( const IntegerRangeIterator< IntegerType > l,
const IntegerRangeIterator< IntegerType > r )
friend

Definition at line 216 of file iterators.h.

◆ operator- [2/2]

template<typename IntegerType>
IntegerRangeIterator operator- ( IntegerRangeIterator< IntegerType > it,
difference_type n )
friend

Definition at line 211 of file iterators.h.


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