This commit is contained in:
Nathan Braswell
2014-08-19 01:24:28 -04:00
parent 5b57770774
commit 5974deece2
11 changed files with 153 additions and 81 deletions

View File

@@ -27,12 +27,12 @@ typedef template<T> vector (Destructable) {
delete<T>(data, 0);
return true;
}
|T| at(|int| index) {
return get(index);
|T| operator[](|int| index) {
return at(index);
}
|T| get(|int| index) {
|T| at(|int| index) {
if (index < 0 || index >= size) {
println("Vector access out of bounds! Retuning 0th element as sanest option");
return data[0];