As others have stated, `BOOST_PP_SEQ_FOR_EACH` is not reentrant. One simple workaround is to use deferred expressions, like this: #define BOOST_PP_SEQ_FOR_EACH_R_ID() BOOST_PP_SEQ_FOR_EACH_R #define DEFER(x) x BOOST_PP_EMPTY() #define S0 (0)(1)(2)(3) #define S1 (5)(6)(7)(8) #define M4(R, DATA, ELEM) (DATA,ELEM) #define M2(R, DATA, ELEM) DEFER(BOOST_PP_SEQ_FOR_EACH_R_ID)()(R, M4, ELEM, S1); BOOST_PP_EXPAND(BOOST_PP_SEQ_FOR_EACH_R(1, M2, ~, S0)) If more depths are needed, just add more `BOOST_PP_EXPAND` macros. Also, you can reuse the recursion state so you could write `M2` like this: #define M2(R, DATA, ELEM) DEFER(BOOST_PP_SEQ_FOR_EACH_R_ID)()(1, M4, ELEM, S1); or like this, if you don't know the original recursion state: #define M2(R, DATA, ELEM) DEFER(BOOST_PP_SEQ_FOR_EACH_R_ID)()(BOOST_PP_DEC(R), M4, ELEM, S1); Paul Fultz II