|
CkPttn 1.2.4
|
Shift Array container with shifted index access. More...
#include <array_like.hpp>


Public Member Functions | |
| ShiftArray () | |
| Construct a new Shift Array object. | |
| ShiftArray (Container &&base) | |
| Construct a new Shift Array object. | |
| void | set_start (const size_t &start) |
| Set the start index for shifted access. | |
| auto | operator[] (const size_t &index) const -> const value_type & |
| Access element with shifted index (const version). | |
| auto | operator[] (const size_t &index) -> value_type & |
| Access element with shifted index (non-const version). | |
Shift Array container with shifted index access.
The ShiftArray class extends a given container type to allow accessing elements using shifted indices. The shift value is set using set_start, and shifted indices are calculated by subtracting the shift value from the original index.
| Container | The underlying container type (e.g. std::vector) |
|
inline |
Construct a new Shift Array object.
|
inlineexplicit |
Construct a new Shift Array object.
| [in] | base |
|
inline |
Access element with shifted index (non-const version).
| [in] | index | The shifted index |
|
inline |
Access element with shifted index (const version).
| [in] | index | The shifted index |
|
inline |
Set the start index for shifted access.
| [in] | start | The starting index offset |