Loading...
Searching...
No Matches
Dune::IntegralRange< T > Class Template Reference
Common » Utilities » Range Utilities

dynamic integer range for use in range-based for loops More...

`#include <dune/common/rangeutilities.hh>`

## Public Types

typedef T | value_type
| type of integers contained in the range
typedef Impl::IntegralRangeIterator< T > | iterator
| type of iterator
typedef std::make_unsigned_t< T > | size_type
| unsigned integer type corresponding to value_type

## Public Member Functions

constexpr | IntegralRange (value_type from, value_type to) noexcept
| construct integer range [from, to)
constexpr | IntegralRange (value_type to) noexcept
| construct integer range [0, to)
constexpr | IntegralRange (std::pair< value_type, value_type > range) noexcept
| construct integer range std::pair
constexpr iterator | begin () const noexcept
| obtain a random-access iterator to the first element
constexpr iterator | end () const noexcept
| obtain a random-access iterator past the last element
constexpr value_type | operator[] (const value_type &i) const noexcept
| access specified element
constexpr bool | empty () const noexcept
| check whether the range is empty
constexpr size_type | size () const noexcept
| obtain number of elements in the range
constexpr bool | contains (value_type index) const noexcept
| check whether given index is within range [from, to)

## Detailed Description

template<class T>
class Dune::IntegralRange< T >

dynamic integer range for use in range-based for loops

Note
  This range can also be used in Hybrid::forEach, resulting in a dynamic for loop over the contained integers.

Template Parameters

  T | type of integers contained in the range

## Member Typedef Documentation

## iterator

template<class T>

typedef Impl::IntegralRangeIterator<T> Dune::IntegralRange< T >::iterator

type of iterator

## size_type

template<class T>

typedef std::make_unsigned_t<T> Dune::IntegralRange< T >::size_type

unsigned integer type corresponding to value_type

## value_type

template<class T>

typedef T Dune::IntegralRange< T >::value_type

type of integers contained in the range

## Constructor & Destructor Documentation

## IntegralRange() [1/3]

template<class T>

Dune::IntegralRange< T >::IntegralRange | ( | value_type | from,
|  | value_type | to )

inline constexpr noexcept

construct integer range [from, to)

## IntegralRange() [2/3]

template<class T>

Dune::IntegralRange< T >::IntegralRange | ( | value_type | to | ) |

inline explicit constexpr noexcept

construct integer range [0, to)

## IntegralRange() [3/3]

template<class T>

Dune::IntegralRange< T >::IntegralRange | ( | std::pair< value_type, value_type > | range | ) |

inline constexpr noexcept

construct integer range std::pair

## Member Function Documentation

## begin()

template<class T>

iterator Dune::IntegralRange< T >::begin | ( |  | ) | const

inline constexpr noexcept

obtain a random-access iterator to the first element

## contains()

template<class T>

bool Dune::IntegralRange< T >::contains | ( | value_type | index | ) | const

inline constexpr noexcept

check whether given index is within range [from, to)

## empty()

template<class T>

bool Dune::IntegralRange< T >::empty | ( |  | ) | const

inline constexpr noexcept

check whether the range is empty

## end()

template<class T>

iterator Dune::IntegralRange< T >::end | ( |  | ) | const

inline constexpr noexcept

obtain a random-access iterator past the last element

## operator[]()

template<class T>

value_type Dune::IntegralRange< T >::operator[] | ( | const value_type & | i | ) | const

inline constexpr noexcept

access specified element

## size()

template<class T>

size_type Dune::IntegralRange< T >::size | ( |  | ) | const

inline constexpr noexcept

obtain number of elements in the range

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

- rangeutilities.hh