|
|
#define | _BY_EACH_GET_END2() 0, BY_CONSUME_ARGS |
| |
|
#define | _BY_EACH_GET_END1(...) _BY_EACH_GET_END2 |
| |
|
#define | _BY_EACH_GET_END(...) _BY_EACH_GET_END1 |
| |
|
#define | _BY_EACH_NEXT0(test, next, ...) next BY_VOID() |
| |
|
#define | _BY_EACH_NEXT1(test, next) _BY_EACH_NEXT0(test, next, 0) |
| |
|
#define | _BY_EACH_NEXT(test, next) _BY_EACH_NEXT1(_BY_EACH_GET_END test, next) |
| |
|
#define | _BY_EACH_LIST_NEXT1(test, next) _BY_EACH_NEXT0(test, BY_COMMA next, 0) |
| |
|
#define | _BY_EACH_LIST_NEXT(test, next) _BY_EACH_LIST_NEXT1(_BY_EACH_GET_END test, next) |
| |
|
#define | _BY_EACH0(f, x, peek, ...) f(x) _BY_EACH_NEXT(peek, _BY_EACH1)(f, peek, __VA_ARGS__) |
| |
|
#define | _BY_EACH1(f, x, peek, ...) f(x) _BY_EACH_NEXT(peek, _BY_EACH0)(f, peek, __VA_ARGS__) |
| |
|
#define | BY_EACH(f, ...) BY_EVAL(_BY_EACH1(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) |
| |
|
#define | _BY_EACH_TUPLE0(f, x, peek, ...) f x _BY_EACH_NEXT(peek, _BY_EACH_TUPLE1)(f, peek, __VA_ARGS__) |
| |
|
#define | _BY_EACH_TUPLE1(f, x, peek, ...) f x _BY_EACH_NEXT(peek, _BY_EACH_TUPLE0)(f, peek, __VA_ARGS__) |
| |
|
#define | BY_EACH_TUPLE(f, ...) BY_EVAL(_BY_EACH_TUPLE1(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) |
| |
|
#define | _BY_EACH_EXPAND0(f, s, x, peek, ...) f(s, x) _BY_EACH_NEXT(peek, _BY_EACH_EXPAND1)(f, s, peek, __VA_ARGS__) |
| |
|
#define | _BY_EACH_EXPAND1(f, s, x, peek, ...) f(s, x) _BY_EACH_NEXT(peek, _BY_EACH_EXPAND0)(f, s, peek, __VA_ARGS__) |
| |
|
#define | BY_EACH_EXPAND(f, ...) BY_EVAL(_BY_EACH_EXPAND1(f, s, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) |
| |
|
#define | _BY_EACH_LIST0(f, x, peek, ...) f(x) _BY_EACH_LIST_NEXT(peek, _BY_EACH_LIST1)(f, peek, __VA_ARGS__) |
| |
|
#define | _BY_EACH_LIST1(f, x, peek, ...) f(x) _BY_EACH_LIST_NEXT(peek, _BY_EACH_LIST0)(f, peek, __VA_ARGS__) |
| |
|
#define | BY_EACH_LIST(f, ...) BY_EVAL(_BY_EACH_LIST1(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) |
| |
Macro-based foreach implementation for C++ iteration