preprocessor: add COUNT_MAP
This commit is contained in:
parent
d736ecf6e6
commit
3416442dda
@ -168,6 +168,10 @@ if __name__ == '__main__':
|
||||
|
||||
#define APPEND_COMMA(X) X,
|
||||
|
||||
#define ONE_PLUS(ARG) 1+
|
||||
/// Given the functional macro `FUNC`, that applies some macro to a list of
|
||||
/// elements, find the number of elements in `FUNC`.
|
||||
#define COUNT_MAP(FUNC) (FUNC(ONE_PLUS)+0)
|
||||
|
||||
#define STRINGIZE_DETAIL(x) #x
|
||||
#define STRINGIZE(x) STRINGIZE_DETAIL(x)
|
||||
|
Loading…
Reference in New Issue
Block a user