|
Boost : |
Subject: Re: [boost] [preprocessor] Chaos: Auto macros incorrectly deduces the recursion state
From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2012-05-08 12:04:55
On 5/8/2012 6:42 AM, paul Fultz wrote:
> Showing CHAOS_IP_AUTO_ENUM_1 is incorrect, and its why it
> won't expand since its trying to be expanded recursively. It
> should be CHAOS_IP_AUTO_ENUM_2 instead. I'm not sure
> why it incorrectly deduces the recursion state. TTP is not a
> deferred expression. Any ideas?
Please e-mail me directly, and I will take a look.
FWIW, in comparison to Boost, Chaos generalizes recursion primarily by
generalizing an "algorithmic step." Doing so keeps large lists of
essentially equivalent macro definitions out of the algorithms. That is
one of the reasons why many have seen me write stuff like
CHAOS_PP_EXPR(CHAOS_PP_ENUM(...))
many times. However, Chaos also provides (a much smaller number) of
entry point thunks (which I rarely use). These *do* require lists (but
much smaller lists) of macro definitions per algorithm. These are the
CHAOS_PP_AUTO_ macros such as CHAOS_PP_AUTO_ENUM(...) referred to by the
Paul Fultz above--which I rarely personally use and apparently broke
somehow.
So, essentially, you have a large number of algorithmic steps that are
generic and reusable, and a small number of entry point thunks. Without
looking, I believe the number of entry point thunks is just 16, so you'd
have up to 16 levels of nesting (e.g.) CHAOS_PP_AUTO_ENUM which are
independent of algorithmic steps.
Regards,
Paul Mensonides
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk