diff options
Diffstat (limited to 'src/TinyVector.h')
-rw-r--r-- | src/TinyVector.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/TinyVector.h b/src/TinyVector.h index 1904f2a..5a30ff6 100644 --- a/src/TinyVector.h +++ b/src/TinyVector.h @@ -97,7 +97,7 @@ struct __attribute__((packed)) TinyVector Data[i] = Data[i + 1];*/ } - int Find(T needle) + int Find(T needle) const { for (int i = 0; i < Length; i++) { @@ -125,6 +125,12 @@ struct __attribute__((packed)) TinyVector assert(index >= 0 && index < Length); return Data[index]; } + + const T& operator[](int index) const + { + assert(index >= 0 && index < Length); + return Data[index]; + } }; } |