Skip to content

strata::seq

Part of Views and expressions.

template <Extent Size = Dyn>
class strata::seq;

A range of indices along one axis: where a block starts and how many elements it takes.

seq{1, 4} is the indices 1, 2 and 3, a size known at run time. seq<2>{i} starts at i and takes two, a size fixed by the type: the shape of the block then has a static extent.

Template parameters

Name Description
Size The number of indices: a number for a static size, Dyn for one given at run time.

Members

extent

static constexpr auto extent = Size

The size as a Shape extent: static, or Dyn.

seq

template <index_like From, index_like To>
constexpr seq(From from, To to) noexcept

The range [from, to).

Precondition

Both indices are non-negative and from <= to.

template <index_like From>
explicit constexpr seq(From from) noexcept

The range that starts at from and takes Size indices.

Precondition

from is non-negative.

first

constexpr std::size_t first() const noexcept

The first index of the range.

size

constexpr std::size_t size() const noexcept

The number of indices in the range.