From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2005-02-12 19:35:42
> Is there any particular reason why you need 'i' in the outer dimension?
> regular SEQ_FOR_EACH and SEQ_FOR_EACH_I should work together:
Actually yes, I do need it -- I am generating series of typedefs, each one
depending on the previous, and I need to generate names for them. I also
need 'i' in the inner loop.
My guess is, I have to use REPEAT, passing sequence as auxiliary data, and
using SEQ_ELEM to access current element. This looks a little clumsier, and
probably less efficient (?) than more native SEQ_FOR_EACH, but it's fine
with me as long as I know that this is the best I can do in this case
(REPEAT *is* reentrant, right?).
Also, do I understand correctly, that, if I wanted to wrap the call to
REPEAT in yet another macro, something like SEQ_ENUM[_TRAILING](seq, macro),
I would have to take care myself of this macro to be reentrant? In the
simplest case, I would just have to provide two identical macros, SEQ_ENUM_0
and SEQ_ENUM_1, and use the first one outside, and the second -- inside
(this would take care of one layer nesting).
> (Of course, this design limitation doesn't exist in Chaos. All
> macros are reentrant--without implementation replication.)
But I would still have to take special care of reentrancy of my own macros,
correct? I actually think disallowing recursion of function-like macros is
totally artificial and unjustified in the first place :-(
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk