10namespace stratax::indexing {
31 ?
static_cast<size_type>(-(index + 1)) + 1
34 if ((index >= 0 &&
static_cast<size_type>(index) >= size) ||
35 (index < 0 && magnitude > size))
40 return index >= 0 ?
static_cast<size_type>(index) : size - magnitude;
Stratax exception types derived from std::runtime_error.
size_type normalize_index(difference_type index, size_type size)
Validates a signed index and converts it to a non-negative offset.
std::ptrdiff_t difference_type
Signed type for Python-style indices.
std::size_t size_type
Unsigned extent and normalized-index type.
Index or slice cannot be used for the requested access.