Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost preprocessor question
From: Michiel Helvensteijn (m.helvensteijn_at_[hidden])
Date: 2009-01-05 16:47:24


Steven Watanabe wrote:

>> * Foo is remembered to use in the constructor name.
>
> Not possible.
>
>> What would the original code look like if we could make this work?
>
> CLASS(Foo, FROM(Bar))
> CONSTRUCT(Foo, BOOST_PP_EMPTY_SEQ)
> CONSTRUCT(Foo, (int, a, A)(bool, b, B))
> int A;
> bool B;
> END_CLASS
>
> is possible.

What about:

CLASS(Foo, FROM(Bar),
    CONSTRUCT(BOOST_PP_EMPTY_SEQ)
    CONSTRUCT((int, a, A)(bool, b, B))
    int A;
    bool B;
)

Might that not be a way to avoid the Foo repetition?

>> And is
>> there something in the boost preprocessor library that can help me?
>
> The following at least might be useful
> http://www.boost.org/libs/preprocessor/doc/ref/seq_enum.html
> http://www.boost.org/libs/preprocessor/doc/ref/tuple_elem.html

Thanks! I'll have a look there.

-- 
Michiel Helvensteijn

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