
18 Mar
2013
18 Mar
'13
9:54 p.m.
The second way is to use sequence iteration, like this:
Sorry, for the sequence iteration it should be more like this: #define FLATTEN_II(r, data, x) x #define FLATTEN_I(seq) BOOST_PP_SEQ_FOR_EACH(FLATTEN_II, ~, seq) #define FLATTEN(seq) BOOST_PP_CAT(FLATTEN_1 seq, _END) #define FLATTEN_1(x) (FLATTEN_I(x)) FLATTEN_2 #define FLATTEN_2(x) (FLATTEN_I(x)) FLATTEN_1 #define FLATTEN_1_END #define FLATTEN_2_END // expands to a b c d e f FLATTEN ( ( (a)(b)(c) ) ( (d)(e)(f) ) )
Thanks, Paul Fultz II