
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Arkadiy Vertleyb
Hi Arkadiy.
I don't think that reentrancy mechanism is working for this macro. Is it supposed to?
SEQ_FOR_EACH_I is not a reentrant construct. Basically, only macros with a "concatenation" variant (e.g. REPEAT_ ## z) are reentrant. All others are reentrant into those macros. This is a fundamental flaw of the pp-lib design. In order to allow what you're suggesting, I'd have to make hundreds of copies of every higher-order macro in the library. Is there any particular reason why you need 'i' in the outer dimension? If not, regular SEQ_FOR_EACH and SEQ_FOR_EACH_I should work together: #include <boost/preprocessor/seq/for_each.hpp> #include <boost/preprocessor/seq/for_each_i.hpp> #define A(r, data, elem) \ BOOST_PP_SEQ_FOR_EACH_I_R(r, B, ~, elem) \ /**/ #define B(r, data, i, elem) elem BOOST_PP_SEQ_FOR_EACH( A, ~, ((1)(2)(3)) ((4)(5)(6)) ((7)(8)(9)) ) (Of course, this design limitation doesn't exist in Chaos. All higher-order macros are reentrant--without implementation replication.) Regards, Paul Mensonides