Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2005-12-29 22:18:16


"Paul Mensonides" <pmenso57_at_[hidden]> 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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk