ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::ranges::iota_view< incr_t > Class Template Reference

Range factory that produces a sequence of values. More...

#include <detray/utils/ranges/iota.hpp>

Inheritance diagram for detray::ranges::iota_view< incr_t >:
[legend]
Collaboration diagram for detray::ranges::iota_view< incr_t >:
[legend]

Public Types

using iterator_t = iterator
 Iterator over generated values in the requested sequence.

Public Member Functions

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
Public Member Functions inherited from detray::ranges::view_interface< iota_view< 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.

Detailed Description

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_tthe 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.

Constructor & Destructor Documentation

◆ iota_view() [1/3]

template<std::incrementable incr_t>
template<concepts::interval interval_t>
requires (!std::same_as<interval_t, iota_view>)
detray::ranges::iota_view< incr_t >::iota_view ( interval_t && interval)
explicitconstexpr

Construct from an interval that defines start and end values.

Parameters
intervalhalf-open interval supplying the sequence bounds

◆ iota_view() [2/3]

template<std::incrementable incr_t>
detray::ranges::iota_view< incr_t >::iota_view ( incr_t start,
incr_t end )
constexpr

Construct from a start start and end value.

Parameters
startfirst value in the sequence
endone-past-the-last value in the sequence

◆ iota_view() [3/3]

template<std::incrementable incr_t>
detray::ranges::iota_view< incr_t >::iota_view ( incr_t start)
explicitconstexpr

Construct from just a start value to represent a single value seq.

Parameters
startsole value in the sequence

Member Function Documentation

◆ begin()

template<std::incrementable incr_t>
auto detray::ranges::iota_view< incr_t >::begin ( ) const->iterator_t
constexpr
Returns
start position of range on container.

◆ end()

template<std::incrementable incr_t>
auto detray::ranges::iota_view< incr_t >::end ( ) const->iterator_t
constexpr
Returns
sentinel of a sequence.

◆ size()

template<std::incrementable incr_t>
auto detray::ranges::iota_view< incr_t >::size ( ) const->incr_t
constexpr
Returns
the span of the sequence