summaryrefslogtreecommitdiff
path: root/src/array.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/array.h')
-rw-r--r--src/array.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/array.h b/src/array.h
index 9affdde..e50ecd4 100644
--- a/src/array.h
+++ b/src/array.h
@@ -17,5 +17,7 @@
#define ARR_APPEND(A) (((A).cap == (A).len) \
? (A).data = realloc((A).data, sizeof *(A).data * ((A).cap = (A).cap ? (A).cap * 2 : 1)) \
: NULL, &((A).data)[(A).len++])
+#define ARR_ITER(A, I) \
+ for (typeof((A).data) (I) = (A).data; (size_t) ((I) - (A).data) < (A).len; (I)++)
#endif