strata::SemiStaticValues¶
Part of Utilities.
Values of which the type fixes some and stores the others, in order.
SemiStaticValues<3, dyn_marker, 5> holds one size_t. What a Shape's extents and a mapping's strides are both made of; std::extents without its interface.
Template parameters
| Name | Description |
|---|---|
Values | One per position: the value the type fixes there, or the maximum of std::size_t (dyn_marker) where the value is stored. |
Members¶
size¶
The number of values, fixed and stored.
dyn_count¶
static constexpr std::size_t dyn_count = static_cast<std::size_t>(std::ranges::count(spec_, detail::dyn_marker))
The number of stored values.
static_value_at¶
The value the type fixes at idx, if any.
Precondition
idx < size.
operator[]¶
The value at idx, fixed or stored.
Precondition
idx < size.
dyn_values¶
The stored values, in order; empty when every value is static.
set¶
Sets the value at idx: stored where it is not static, checked against the type where it is.
Precondition
idx < size, and where the value is static, value equals it.
set_dyn¶
Sets the slot-th stored value directly: for values given without the static ones between.
Precondition
slot < dyn_count.