Celeritas
0.5.0-56+6b053cd
|
Proxy container for iterating over a range of integral values. More...
#include <Range.hh>
Public Member Functions | |
CELER_CONSTEXPR_FUNCTION value_type | operator[] (size_type i) const |
Array-like access. | |
CELER_CONSTEXPR_FUNCTION size_type | size () const |
Number of elements. | |
CELER_CONSTEXPR_FUNCTION bool | empty () const |
Whether the range has no elements. | |
CELER_CONSTEXPR_FUNCTION value_type | front () const |
First item in the range. | |
CELER_CONSTEXPR_FUNCTION value_type | back () const |
Last item in the range. | |
template<class U , std::enable_if_t< std::is_signed< U >::value, bool > = true> | |
CELER_CONSTEXPR_FUNCTION detail::StepRange< step_type< U > > | step (U step) |
Return a stepped range using a signed integer type. | |
Type aliases | |
using | const_iterator = detail::range_iter< T > |
Empty constructor for empty range. | |
using | size_type = typename TraitsT::counter_type |
Empty constructor for empty range. | |
using | value_type = T |
Empty constructor for empty range. | |
template<class U > | |
using | step_type = typename TraitsT::template common_type< U > |
Empty constructor for empty range. | |
CELER_CONSTEXPR_FUNCTION | Range () |
Empty constructor for empty range. | |
CELER_CONSTEXPR_FUNCTION | Range (T end) |
Construct from stop. | |
CELER_CONSTEXPR_FUNCTION | Range (T begin, T end) |
Construct from start/stop. | |
CELER_CONSTEXPR_FUNCTION const_iterator | begin () const |
CELER_CONSTEXPR_FUNCTION const_iterator | cbegin () const |
Empty constructor for empty range. | |
CELER_CONSTEXPR_FUNCTION const_iterator | end () const |
Empty constructor for empty range. | |
CELER_CONSTEXPR_FUNCTION const_iterator | cend () const |
Empty constructor for empty range. | |
Proxy container for iterating over a range of integral values.
Here, T can be any of:
It is OK to dereference the end iterator! The result should just be the off-the-end value for the range, e.g. FooEnum::size_
or bar.size()
.
|
inline |
Iterators