Iterate in the preprocessor. More...
Macros | |
#define | DO_BODY(X) |
The body that will be invoked for each iteration value X | |
#define | DO_BOUNDS |
The bounds that must be set before entering this source. | |
#define | DO_DIRECTIVES |
A name of a file that is included for its directives at each iteration. | |
#define | DO_RESULT |
The name of the macro that will hold the result of the iteration. | |
#define | DO_SEPARATOR |
A separator that is inserted between each iteration. | |
Iterate in the preprocessor.
This needs the macros DO_BOUNDS to be set on entrance.
Use this as in
After that the macro list
should expand to something similar to
Macros DO_RESULT, DO_BODY, DO_SEPARATOR and DO_DIRECTIVES may optionally be defined to control the outcome of the inclusion.
Obviously you should have one of DO_BODY and DO_DIRECTIVES such that this file has any effect at all.
So for example if you'd add
to the example above, the items would additionally separated by commas.
#define DO_BODY | ( | X | ) |
The body that will be invoked for each iteration value X
#define DO_BOUNDS |
The bounds that must be set before entering this source.
It is used to determine three values, DO_START()
, DO_END()
and DO_INCR()
.
0
and ends before that number.If not provided, the increment is 1
.
#define DO_DIRECTIVES |
A name of a file that is included for its directives at each iteration.
Within that file you may use the macro ::DO_START() to refer to the current iteration.
This can for example be used to define a macro at each iteration.
#define DO_RESULT |
The name of the macro that will hold the result of the iteration.
#define DO_SEPARATOR |
A separator that is inserted between each iteration.
This macro is optional.