[preprocessor] Nested FOR_EACHs

27 Apr
2009
27 Apr
'09
1:12 a.m.
Hello, is it possible to nest FOR_EACH statements with the preprocessor? In my example it seems not to work: #include <boost/preprocessor/seq/for_each_i.hpp> #define DECLARE_TEST2(r,data,i,elem) \ 1; /**/ #define DECLARE_TEST(r,data,i,elem) \ BOOST_PP_SEQ_FOR_EACH_I(DECLARE_TEST2,data,data); /**/ #define SEQ ((1)(NACK_SN)(10)) ((1)(E1)(1)) ((1)(E2)(1)) int main(){ BOOST_PP_SEQ_FOR_EACH_I(DECLARE_TEST,SEQ,SEQ) return 0; } Thanks a lot for comments. Reimund
5897
Age (days ago)
5897
Last active (days ago)
0 comments
1 participants
participants (1)
-
Reimund Klemm