A base interface for all objects whose elements can be directly indexed. More...
#include <indexable.hpp>
Public Member Functions | |
virtual | ~indexable () noexcept |
Virtual destructor. | |
virtual T | at (int index) const =0 |
Function to get the object at the given index. | |
virtual T | operator[] (int index) const |
Function to get the object at the given index. | |
A base interface for all objects whose elements can be directly indexed.
Function to get the object at the given index.
index | the index of the desired object. |
Implemented in z::core::circularBuffer< TYPE, LEN >, z::core::string< E >, z::core::string< ascii >, z::core::string< z::utf8 >, z::core::array< T >, and z::core::array< zstring * >.
|
inlinevirtual |
Function to get the object at the given index.
Identical behavior to at(int), but allows indexing with square brackets.
index | the index of the desired object. |
Implemented in z::core::array< T >, and z::core::array< zstring * >.