aboutsummaryrefslogtreecommitdiff
path: root/collections/vector/vector.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'collections/vector/vector.adoc')
-rw-r--r--collections/vector/vector.adoc17
1 files changed, 16 insertions, 1 deletions
diff --git a/collections/vector/vector.adoc b/collections/vector/vector.adoc
index 76c0f7a..f1e29e2 100644
--- a/collections/vector/vector.adoc
+++ b/collections/vector/vector.adoc
@@ -1,7 +1,7 @@
Vector
======
Tucker Evans
-v0.7.2, 2020-07-03
+v0.8, 2020-07-03
A basic vector, that hold pointers to your data structures.
@@ -65,6 +65,21 @@ vec_push_back(vector, NULL);
assert(vec_size(vector) == 1);
----
++int vec_capacity(vec *self)+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Returns the maximun number of elements in vector +self+ before the buffer needs
+to be resized (does not take the current size into consideration).
+
+Examples
+^^^^^^^^
+[source,c]
+----
+#include "vector.h"
+
+vec *vector = vec_with_capacity(16);
+assert(vec_capacity(vector) == 16);
+----
+
[[vec_cp]]
+vec* vec_cp(vec *self)+
~~~~~~~~~~~~~~~~~~~~~~~~