P99
|
◆ P99_LENGTH_ARR_ARG
Helper macro to declare a variable length parameter list. Wrap your function in a macro that uses P99_LENGTH_ARR_ARG. If used through that macro, the correct value for #define tutu(A, ...) P99_FSYMB(tutu)(A, P99_LENGTH_ARR_ARG(unsigned const, __VA_ARGS__))
In the definition of the function you then may use an array of the arguments in the obvious way. In this toy example unsigned magic = tutu(3, 1, 3, 5, 7);
which will result in converting 1, 3, 5, 7 (the variable arguments) to In the example The method here is generally more efficient than using P99_VA_ARGS since it results in code that can be inlined more easily by the compiler. In particular, if a function such as
Definition at line 282 of file p99_args.h. |