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

#include <iterators.h>

Inheritance diagram for util::IntegerRange< IntegerType >:
util::BeginEndWrapper< IntegerRangeIterator< IntegerType > >

Public Member Functions

 IntegerRange (IntegerType begin, IntegerType end)
 
- Public Member Functions inherited from util::BeginEndWrapper< IntegerRangeIterator< IntegerType > >
 BeginEndWrapper (IntegerRangeIterator< IntegerType > begin, IntegerRangeIterator< IntegerType > end)
 
IntegerRangeIterator< IntegerType > begin () const
 
IntegerRangeIterator< IntegerType > end () const
 
size_t size () const
 
bool empty () const
 

Additional Inherited Members

- Public Types inherited from util::BeginEndWrapper< IntegerRangeIterator< IntegerType > >
using const_iterator
 
using value_type
 

Detailed Description

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

Allows to easily construct nice functions for range-based for loop. This can be used like this:

for (const int i : IntegerRange<int>(0, 10)) { ... }

But it main purpose is to be used as return value for more complex classes:

for (const ArcIndex arc : graph.AllOutgoingArcs()); for (const NodeIndex node : graph.AllNodes());

Definition at line 147 of file iterators.h.

Constructor & Destructor Documentation

◆ IntegerRange()

template<typename IntegerType >
util::IntegerRange< IntegerType >::IntegerRange ( IntegerType begin,
IntegerType end )
inline

Definition at line 149 of file iterators.h.


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