Add _erase for array

This commit is contained in:
Patrick Pelissier committed 2018-10-27 23:30:21 +02:00
1 parent bd315c7e43
commit 6672becdd5
2 files changed
+17

No files matched your search

+9
View File
@@ -468,6 +468,15 @@
memmove(&v->ptr[i], &v->ptr[i+1], sizeof(type)*(v->size - i) ); \
v->size--; \
ARRAYI_CONTRACT(v); \
} \
\
static inline bool \
M_C(name, _erase)(array_t a, size_t i) \
{ \
ARRAYI_CONTRACT(a); \
if (i >= a->size) return false; \
M_C(name, _pop_at)(NULL, a, i); \
return true; \
} \
\
M_IF_METHOD(INIT, oplist)( \