Add some documentation
This commit is contained in:
parent
001e3638fe
commit
27b42b6ed1
@ -1,9 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// Will determine the size of an array only if it is declared on the stack
|
// Will determine the size of an array only if it is declared on the stack
|
||||||
|
// Need to dereference the item, as it is a pointer to the current element
|
||||||
#define foreach(type, item, array) \
|
#define foreach(type, item, array) \
|
||||||
for (type* item = array; item < array + (sizeof(array) / sizeof(type)); item++)
|
for (type* item = array; item < array + (sizeof(array) / sizeof(type)); item++)
|
||||||
|
|
||||||
// Need to pass in the size of the array, since heap allocated arrays don't work with sizeof
|
// Need to pass in the size of the array, since heap allocated arrays don't work with sizeof
|
||||||
|
// Need to dereference the item, as it is a pointer to the current element
|
||||||
#define foreach_p(type, item, array, size) \
|
#define foreach_p(type, item, array, size) \
|
||||||
for (type* item = array; item < array + size; item++)
|
for (type* item = array; item < array + size; item++)
|
||||||
|
Loading…
Reference in New Issue
Block a user