Range factory that produces a sequence of values.
More...
#include <detray/utils/ranges/iota.hpp>
|
|
using | iterator_t = iterator |
| | Iterator over generated values in the requested sequence.
|
|
|
constexpr | iota_view ()=default |
| | Default constructor (only works if imrementable_t is default constructible).
|
| constexpr | iota_view (incr_t start) |
| | Construct from just a start value to represent a single value seq.
|
| constexpr | iota_view (incr_t start, incr_t end) |
| | Construct from a start start and end value.
|
template<concepts::interval interval_t>
requires (!std::same_as<interval_t, iota_view>) |
| constexpr | iota_view (interval_t &&interval) |
| | Construct from an interval that defines start and end values.
|
| constexpr auto | begin () const -> iterator_t |
| constexpr auto | end () const -> iterator_t |
| constexpr auto | size () const -> incr_t |
| 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::incrementable incr_t>
class detray::ranges::iota_view< incr_t >
Range factory that produces a sequence of values.
- See also
- https://en.cppreference.com/w/cpp/ranges/iota_view
- Template Parameters
-
| incr_t | the incrementable type that makes up the sequence |
- Note
- If given single value, does not do infinite iteration, but only jumps to next value.
-
Is not fit for lazy evaluation.
◆ iota_view() [1/3]
template<std::incrementable incr_t>
template<concepts::interval interval_t>
requires (!std::same_as<interval_t, iota_view>)
Construct from an interval that defines start and end values.
- Parameters
-
| interval | half-open interval supplying the sequence bounds |
◆ iota_view() [2/3]
template<std::incrementable incr_t>
Construct from a start start and end value.
- Parameters
-
| start | first value in the sequence |
| end | one-past-the-last value in the sequence |
◆ iota_view() [3/3]
template<std::incrementable incr_t>
Construct from just a start value to represent a single value seq.
- Parameters
-
| start | sole value in the sequence |
◆ begin()
template<std::incrementable incr_t>
- Returns
- start position of range on container.
◆ end()
template<std::incrementable incr_t>
- Returns
- sentinel of a sequence.
◆ size()
template<std::incrementable incr_t>
- Returns
- the span of the sequence