9. これがBOOST_PP_FORだ
# if 0
# define BOOST_PP_FOR(state, pred, op, macro)
# endif
#
# define BOOST_PP_FOR BOOST_PP_CAT(BOOST_PP_FOR_, BOOST_PP_AUTO_REC(BOOST_PP_FOR_P, 256))
#
# define BOOST_PP_FOR_P(n) BOOST_PP_CAT(BOOST_PP_FOR_CHECK_, BOOST_PP_FOR_ ## n(1, BOOST_PP_FOR_SR_P, BOOST_PP_FOR_SR_O,
BOOST_PP_FOR_SR_M))
#
# define BOOST_PP_FOR_SR_P(r, s) s
# define BOOST_PP_FOR_SR_O(r, s) 0
# define BOOST_PP_FOR_SR_M(r, s) BOOST_PP_NIL
#
# define BOOST_PP_FOR_257(s, p, o, m) BOOST_PP_ERROR(0x0002)
#
# define BOOST_PP_FOR_CHECK_BOOST_PP_NIL 1
#
# define BOOST_PP_FOR_CHECK_BOOST_PP_FOR_1(s, p, o, m) 0
# define BOOST_PP_FOR_CHECK_BOOST_PP_FOR_2(s, p, o, m) 0
# define BOOST_PP_FOR_CHECK_BOOST_PP_FOR_3(s, p, o, m) 0
……
# define BOOST_PP_FOR_1(s, p, o, m) BOOST_PP_FOR_1_C(BOOST_PP_BOOL(p(2, s)), s, p, o, m)
# define BOOST_PP_FOR_2(s, p, o, m) BOOST_PP_FOR_2_C(BOOST_PP_BOOL(p(3, s)), s, p, o, m)
# define BOOST_PP_FOR_3(s, p, o, m) BOOST_PP_FOR_3_C(BOOST_PP_BOOL(p(4, s)), s, p, o, m)
……
# define BOOST_PP_FOR_1_C(c, s, p, o, m) BOOST_PP_IIF(c, m, BOOST_PP_TUPLE_EAT_2)(2, s) BOOST_PP_IIF(c, BOOST_PP_FOR_2, BOOST_PP_TUPLE_EAT_4)
(BOOST_PP_EXPR_IIF(c, o)(2, s), p, o, m)
# define BOOST_PP_FOR_2_C(c, s, p, o, m) BOOST_PP_IIF(c, m, BOOST_PP_TUPLE_EAT_2)(3, s) BOOST_PP_IIF(c, BOOST_PP_FOR_3, BOOST_PP_TUPLE_EAT_4)
(BOOST_PP_EXPR_IIF(c, o)(3, s), p, o, m)
# define BOOST_PP_FOR_3_C(c, s, p, o, m) BOOST_PP_IIF(c, m, BOOST_PP_TUPLE_EAT_2)(4, s) BOOST_PP_IIF(c, BOOST_PP_FOR_4, BOOST_PP_TUPLE_EAT_4)
(BOOST_PP_EXPR_IIF(c, o)(4, s), p, o, m)
……