P99
|
◆ P99_UNROLLApply the macro MACRO N times. The macro is called with the numbers In the following example we define an adhoc macro that copies an array element of an array #define ASIZE 3
double A[] = { P99_DUPL(ASIZE, 1.7) };
double B[] = { P99_DUPL(ASIZE, 371) };
#define COPY_A2B(I) B[I] = A[I]
P99_UNROLL(COPY_A2B, ASIZE);
This will expand to B[0] = A[0]; B[1] = A[1]; B[2] = A[2];
Observe that the first two
|