libzed 1.9.9
A general-purpose library for quick and simple data manipulation.
 
Loading...
Searching...
No Matches
indexable.hpp
1#pragma once
2
3namespace z {
4namespace core {
9template <typename T>
10class indexable {
11public:
13 virtual ~indexable() noexcept {}
14
21 virtual T at(int index) const = 0;
22
33 virtual T operator[](int index) const {
34 return at(index);
35 }
36};
37} // namespace core
38} // namespace z
A wrapper for std::vector.
Definition array.hpp:72
A base interface for all objects whose elements can be directly indexed.
Definition indexable.hpp:10
virtual T operator[](int index) const
Function to get the object at the given index.
Definition indexable.hpp:33
virtual T at(int index) const =0
Function to get the object at the given index.
virtual ~indexable() noexcept
Virtual destructor.
Definition indexable.hpp:13