|
Stratax 0.4.0rc1
|
Header: include/stratax/core/Slice.hpp.
Slice(start, stop, step=1) stores raw signed ptrdiff_t bounds for a half-open range. The constructor rejects step zero with Exceptions::IndexError. Bounds are not normalized or clamped until used against an array extent.
start/stop/step return the raw values. size computes the directed range length with unsigned distance arithmetic, avoiding overflow even at extreme signed bounds and steps. empty is size == 0. All queries and construction take O(1). Equality compares all three raw fields; equal selected values do not imply equal Slice descriptors.
Positive steps select indices below stop, negative steps select indices above stop. The descriptor supports either sign, but current public slice views reject negative steps because ArrayView stores unsigned strides.
Slice owns no elements. See Slice Operations for extent normalization, view ownership, rank preservation, and error contracts.