From 4832ab4b43a2e9fb72b1814b32421de1dba1edcb Mon Sep 17 00:00:00 2001
From: Tucker Evans <tucker@tuckerevans.com>
Date: Fri, 3 Jul 2020 00:40:50 -0400
Subject: Add function to get capacity of a vector

---
 collections/vector/vector.adoc | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

(limited to 'collections/vector/vector.adoc')

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)+
 ~~~~~~~~~~~~~~~~~~~~~~~~
-- 
cgit v1.1

