mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 00:28:20 +00:00
[common] vector: add indexed iteration modes
This commit is contained in:
parent
53b4b4818b
commit
377757e743
@ -53,3 +53,14 @@ void vector_clear(Vector * vector);
|
||||
* vecIterEnd = vecIterCurrent + (vector)->size * (vector)->itemSize; \
|
||||
vecIterCurrent < vecIterEnd ? name = (void *)vecIterCurrent, true : false; \
|
||||
vecIterCurrent += (vector)->itemSize)
|
||||
|
||||
#define vector_forEachIdx(index, name, vector) \
|
||||
for (size_t index = 0; \
|
||||
index < (vector)->size ? vector_at((vector), index, &(name)), true : false; \
|
||||
++index)
|
||||
|
||||
|
||||
#define vector_forEachRefIdx(index, name, vector) \
|
||||
for (size_t index = 0; \
|
||||
index < (vector)->size ? (name) = vector_ptrTo((vector), index), true : false; \
|
||||
++index)
|
||||
|
Loading…
Reference in New Issue
Block a user