|
Stratax 0.4.0rc1
|
Checked signed index normalization. More...


Go to the source code of this file.
Typedefs | |
| using | stratax::indexing::size_type = std::size_t |
| Unsigned extent and normalized-index type. | |
| using | stratax::indexing::difference_type = std::ptrdiff_t |
| Signed type for Python-style indices. | |
Functions | |
| size_type | stratax::indexing::normalize_index (difference_type index, size_type size) |
| Validates a signed index and converts it to a non-negative offset. | |
Checked signed index normalization.
Definition in file Normalize.hpp.
| typedef std::ptrdiff_t stratax::indexing::difference_type |
Signed type for Python-style indices.
Signed type used for normalized slice positions and steps.
Definition at line 15 of file Normalize.hpp.
| typedef std::size_t stratax::indexing::size_type |
Unsigned extent and normalized-index type.
Unsigned type used for extents, counts, and flat offsets.
Definition at line 13 of file Normalize.hpp.
|
inline |
Validates a signed index and converts it to a non-negative offset.
| index | Index in [-size, size); negative values count from the end. |
| size | Number of elements in the indexed dimension. |
-1 selects size - 1 when nonempty. | Exceptions::IndexError | If the index is out of bounds, including every index when size is zero. |
Definition at line 26 of file Normalize.hpp.