|
Metalang99 1.13.5
Full-blown preprocessor metaprogramming
|
Variadic arguments: x, y, z. More...

Go to the source code of this file.
Macros | |
| #define | ML99_variadicsCount(...) |
| Computes a count of its arguments. | |
| #define | ML99_variadicsIsSingle(...) |
| Tells if it received only one argument or not. | |
| #define | ML99_variadicsGet(i) |
Expands to a metafunction extracting the i -indexed argument. | |
| #define | ML99_variadicsTail(...) |
| Extracts the tail of its arguments. | |
| #define | ML99_variadicsForEach(f, ...) |
Applies f to each argument. | |
| #define | ML99_variadicsForEachI(f, ...) |
Applies f to each argument with an index. | |
| #define | ML99_OVERLOAD(f, ...) |
Overloads f on a number of arguments. | |
| #define | ML99_VARIADICS_COUNT(...) |
| #define | ML99_VARIADICS_IS_SINGLE(...) |
| #define | ML99_VARIADICS_GET(i) |
| #define | ML99_VARIADICS_TAIL(...) |
Variadic arguments: x, y, z.
| #define ML99_OVERLOAD | ( | f, | |
| ... ) |
Overloads f on a number of arguments.
This function counts the number of provided arguments, appends it to f and calls the resulting macro identifier with provided arguments.
At most 63 variadic arguments are acceptable.
f need not be postfixed with _IMPL. It is literally invoked as ML99_CAT(f,
ML99_VARIADICS_COUNT(...))(...). | #define ML99_VARIADICS_COUNT | ( | ... | ) |
| #define ML99_VARIADICS_GET | ( | i | ) |
| #define ML99_VARIADICS_IS_SINGLE | ( | ... | ) |
| #define ML99_VARIADICS_TAIL | ( | ... | ) |
| #define ML99_variadicsCount | ( | ... | ) |
Computes a count of its arguments.
At most 63 arguments are acceptable.
| #define ML99_variadicsForEach | ( | f, | |
| ... ) |
Applies f to each argument.
The result is ML99_appl(f, x1) ... ML99_appl(f, xN).
| #define ML99_variadicsForEachI | ( | f, | |
| ... ) |
Applies f to each argument with an index.
The result is ML99_appl2(f, x1, 0) ... ML99_appl2(f, xN, N - 1).
| #define ML99_variadicsGet | ( | i | ) |
Expands to a metafunction extracting the i -indexed argument.
i can range from 0 to 7, inclusively.
| #define ML99_variadicsIsSingle | ( | ... | ) |
Tells if it received only one argument or not.
| #define ML99_variadicsTail | ( | ... | ) |
Extracts the tail of its arguments.
At least two arguments must be specified.