|
|
constexpr | enumerate_view ()=default |
| | Default constructor (only works if imrementable_t is default constructible).
|
template<detray::ranges::range range_t>
requires (!std::same_as<range_t, enumerate_view>) |
| constexpr | enumerate_view (range_t &&rng) |
| | Construct from a rng that will be enumerated beginning at 0.
|
| template<detray::ranges::range range_t> |
| constexpr | enumerate_view (range_t &&rng, incr_t start) |
| | Enumerate rng beginning at start.
|
| constexpr auto | begin () -> iterator |
| constexpr auto | begin () const -> iterator |
| constexpr auto | end () const -> iterator |
| constexpr decltype(auto) | back () const |
| | Return a reference to the last element.
|
| constexpr auto | data () const |
| | Return a pointer to the first element, or null for an empty view.
|
| constexpr auto | empty () const -> bool |
| | Check whether the view contains no elements.
|
| constexpr decltype(auto) | front () const |
| | Return a reference to the first element.
|
| constexpr | operator bool () const |
| | Test whether the view contains at least one element.
|
| constexpr decltype(auto) | operator[] (const dindex i) const |
| | Subscript operator that takes detray dindex.
|
| constexpr auto | size () const |
| | Return the number of elements in the view.
|
template<std::input_iterator range_itr_t, std::incrementable incr_t>
class detray::ranges::enumerate_view< range_itr_t, incr_t >
Enumerates the elements of a range on the fly.
- Template Parameters
-
| range_itr_t | the iterator type of the enumerated range |
| incr_t | a type that can be incremented in lockstep with the iterator 'range_itr_t'. |
- Note
- Does not take ownership of the range it operates on. Its lifetime needs to be guaranteed throughout iteration or between iterations with the same enumerate instance.
-
Is not fit for lazy evaluation.