
"Paul Mensonides" <pmenso57@comcast.net> wrote
Since the implementation of REGISTER_TEMPLATE itself uses quite a few looping constructs, people ran into re-entrancy issues.
Which looping constructs does it use?
Currently at least the following: REPEAT ENUM SEQ_ENUM SEQ_FOR_EACH_I SEQ_FOLD_LEFT
I would like the users to be able to use the macro with whichever looping construct they prefer, and, AFAIU, the easiast (only?) way to achieve this would be to limit the macro implementation to only use automatically re-entrant macros, such as BOOST_PP_REPEAT.
That depends. If you can (re)specify the implementation in terms of only one "recursion state" (such as 'z' for REPEAT), then it is best to provide both:
#define REGISTER(...) REGISTER_Z(DEDUCE_Z(), ...) #define REGISTER_Z(z, ...) // ...
Is there any significant benefit of specifying z manually? Does it depend on the depth of nesting (typeof just has a sequence inside another sequence)? Regards, Arkadiy