aboutsummaryrefslogtreecommitdiff
path: root/src/vec.hff
diff options
context:
space:
mode:
Diffstat (limited to 'src/vec.hff')
-rw-r--r--src/vec.hff4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vec.hff b/src/vec.hff
index 9099b85..be29fec 100644
--- a/src/vec.hff
+++ b/src/vec.hff
@@ -33,6 +33,10 @@ struct Vec<T> {
}
return vec.dat[0::vec.len];
}
+
+ fn last(vec *const Vec) T { return vec.dat[vec.len - 1]; }
+
+ fn lastp(vec *Vec) *T { return &vec.dat[vec.len - 1]; }
}
defmacro vec_each(x, i, v, ...body) [