dune-common 2.9.0
|
static 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 | |
typedef decltype(shift_integer_sequence< from >(std::make_integer_sequence< T, to-from >())) | integer_sequence |
type of corresponding std::integer_sequence | |
Public Member Functions | |
constexpr | StaticIntegralRange () noexcept=default |
default constructor | |
constexpr | operator IntegralRange< T > () const noexcept |
cast into dynamic IntegralRange | |
constexpr | operator integer_sequence () const noexcept |
cast into corresponding std::integer_sequence | |
template<class U , U i> | |
constexpr auto | operator[] (const std::integral_constant< U, i > &) const noexcept -> std::integral_constant< value_type, from+static_cast< value_type >(i)> |
access specified element (static version) | |
constexpr value_type | operator[] (const size_type &i) const noexcept |
access specified element (dynamic version) | |
Static Public Member Functions | |
static constexpr iterator | begin () noexcept |
obtain a random-access iterator to the first element | |
static constexpr iterator | end () noexcept |
obtain a random-access iterator past the last element | |
static constexpr std::integral_constant< bool, from==to > | empty () noexcept |
check whether the range is empty | |
static constexpr std::integral_constant< size_type, static_cast< size_type >(to) - static_cast< size_type >(from) > | size () noexcept |
obtain number of elements in the range | |
static integer range for use in range-based for loops
This is a compile-time static variant of the IntegralRange. Apart from returning all range information statically, it casts into the corresponding std::integer_sequence.
T | type of integers contained in the range |
to | first element not contained in the range |
from | first element contained in the range, defaults to 0 |
typedef decltype(shift_integer_sequence<from>(std::make_integer_sequence<T, to-from>())) Dune::StaticIntegralRange< T, to, from >::integer_sequence |
type of corresponding std::integer_sequence
typedef Impl::IntegralRangeIterator<T> Dune::StaticIntegralRange< T, to, from >::iterator |
type of iterator
typedef std::make_unsigned_t<T> Dune::StaticIntegralRange< T, to, from >::size_type |
unsigned integer type corresponding to value_type
typedef T Dune::StaticIntegralRange< T, to, from >::value_type |
type of integers contained in the range
|
constexprdefaultnoexcept |
default constructor
|
inlinestaticconstexprnoexcept |
obtain a random-access iterator to the first element
|
inlinestaticconstexprnoexcept |
check whether the range is empty
|
inlinestaticconstexprnoexcept |
obtain a random-access iterator past the last element
|
inlineconstexprnoexcept |
cast into corresponding std::integer_sequence
|
inlineconstexprnoexcept |
cast into dynamic IntegralRange
|
inlineconstexprnoexcept |
access specified element (dynamic version)
|
inlineconstexprnoexcept |
access specified element (static version)
|
inlinestaticconstexprnoexcept |
obtain number of elements in the range