|
nngn
|

Go to the source code of this file.
Macros | |
| #define | NNGN_PASTE(x, y) x ## y |
| Token pasting macro. | |
| #define | NNGN_PASTE2(x, y) NNGN_PASTE(x, y) |
| Token pasting macro, with one level of indirection. | |
| #define | NNGN_ARGC(...) NNGN_ARGC0(__VA_ARGS__ __VA_OPT__(,) 7, 6, 5, 4, 3, 2, 1, 0) |
| Counts the number of arguments given. | |
| #define | NNGN_ARGC0(_0, _1, _2, _3, _4, _5, _6, _7, ...) _7 |
| #define | NNGN_OVERLOAD(f, ...) NNGN_PASTE2(f, NNGN_ARGC(__VA_ARGS__))(__VA_ARGS__) |
| Calls an overloaded macro. | |
| #define NNGN_ARGC | ( | ... | ) | NNGN_ARGC0(__VA_ARGS__ __VA_OPT__(,) 7, 6, 5, 4, 3, 2, 1, 0) |
Counts the number of arguments given.
An empty call yields 0.
| #define NNGN_ARGC0 | ( | _0, | |
| _1, | |||
| _2, | |||
| _3, | |||
| _4, | |||
| _5, | |||
| _6, | |||
| _7, | |||
| ... ) _7 |
| #define NNGN_OVERLOAD | ( | f, | |
| ... ) NNGN_PASTE2(f, NNGN_ARGC(__VA_ARGS__))(__VA_ARGS__) |
Calls an overloaded macro.
The intended usage is:
When F is called, the call will be forwarded to the name resulting from pasting F with the number of arguments.
| #define NNGN_PASTE | ( | x, | |
| y ) x ## y |
Token pasting macro.
| #define NNGN_PASTE2 | ( | x, | |
| y ) NNGN_PASTE(x, y) |
Token pasting macro, with one level of indirection.
Expands its arguments as a result of the rules of macro expansion, which state that argument expansion happens before the replacement text is examined for macro expansion.