|
Boost Users : |
Subject: Re: [Boost-users] [preprocessor] using ENUM_PARAMS to generate macro call arguments
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2011-06-18 11:52:51
2011/6/16 Daniel James <dnljms_at_[hidden]>
> On 15 June 2011 14:15, Krzysztof Czainski <1czajnik_at_[hidden]> wrote:
>
> > My goal here is to keep INVOKE as simple and non-redundant as possible,
> > because alternative versions of INVOKE for alternative sets of given
> macros
> > will be added later on.
> > Now the call A2(1,2) doesn't compile. If I understand correctly, the
> reason
> > is ENUM_PARAMS(n_args,arg) is passed to M2, while I need the result of
> macro
> > expansion of ENUM_PARAMS(...) to be passed to M2. So my question is: Is
> > there a way around this?
>
> Maybe BOOST_PP_EXPAND?
>
> http://www.boost.org/libs/preprocessor/doc/ref/expand.html
>
> Exactly what I needed, thanks a lot, Daniel ;-)
I attach the complete solution using EXPAND in case anyone is interested.
Cheers,
Kris
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net