Helpful preprocessor macros. Main docs: https://pigweed.dev/pw_preprocessor.
Submodules | |
Internal | |
Macros | |
#define | PW_APPLY(macro, separator, forwarded_arg, ...) |
#define PW_APPLY | ( | macro, | |
separator, | |||
forwarded_arg, | |||
... | |||
) |
Repeatedly applies the given macro for each argument provided. The given macro expands to accept an index value of the current argument, the forwarded argument provided, and the current argument. The forwarded argument is used in every macro call. The separator expands to accept the index argument as well as the forwarded argument. The last separator is omitted.
The example below shows how this macro expands, based on a pre-defined macro and separator. The statement PW_APPLY(MACRO, SEP, ARG, a0, a1)
expands to: