|
Boost Users : |
Subject: Re: [Boost-users] BOOST_FUSION_ADAPT_STRUCT: non intrusive macro, get a fusion sequence of struct member types and member names
From: Hicham Mouline (hicham_at_[hidden])
Date: 2010-01-25 04:34:57
----- Original Message -----
From: "Joel de Guzman" <joel_at_[hidden]>
To: <boost-users_at_[hidden]>
Sent: Monday, January 25, 2010 9:38 AM
Subject: Re: [Boost-users] BOOST_FUSION_ADAPT_STRUCT: non intrusive macro,
get a fusion sequence of struct member types and member names
> On 1/24/2010 8:29 PM, Hicham Mouline wrote:
>> Hello,
>> I am aware that it is planned to implement metafunctions that returned
>> the list of member types of a struct, as well as members names, as
>> fusion/mpl sequences. The macro uses some PP magic.
>> My project has progressed that I think I need this feature to proceed. I
>> may try my hand at implementing these features...
>> Which files in boost/fusion are involved in the implementation of the
>> macro?
>
> See boost/fusion/adapted/struct. The member types are already provided
> through
> result_of::at_c.
Of course (this is the kind of mistakes beginners do, not paying
attention:-( )
> The names are not (yet). Be warned, I have to insist on
> updating the docs too :-) Ahem ahem...
>
> Do tell us your proposed interface.
One way is to return a fusion sequence of as many "const char*" as there
are members in the struct, so the types are "const char*" and the runtime
values are the member names.
That wouldn't suit my case as I wouldn't be able to generate the spirit
grammar wiht PP at compile-time.
How can the member names be stored in the type information of the fusion
/mpl sequence as const char* ?
>From what I understand, you can only have template non-type arguments that
have an external linkage.
Hmmm, I don't know.
Docs, absolutely, glad to make any contribution. I need to read up about
quickbook, right?
regards,
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