FOLLY_PP_FOR_EACH

FOLLY_PP_FOR_EACH

Synopsis

Declared in <folly/Preprocessor.h>

#define FOLLY_PP_FOR_EACH(fn, ...)

Description

Used to invoke a preprocessor macro, the name of which is passed as the first argument, once for each subsequent variadic argument.

At present, supports [0, 16) arguments.]

This input:

#define DOIT(a) go_do_it(a); FOLLY_PP_FOR_EACH(DOIT, 3, 5, 7) #undef DOIT

Expands to this output (with whitespace adjusted for clarity):

go_do_it(3); go_do_it(5); go_do_it(7);

Parameters

NameDescription
fnThe macro to invoke once for each subsequent argument.