Boost logo

Boost :

Subject: Re: [boost] [fusion] getting type of attribute_proxy for BOOST_FUSION_ADAPT_ADT
From: Damien Buhl (damien.buhl_at_[hidden])
Date: 2016-03-05 06:53:33


On 04/03/2016 17:32, Jens Weller wrote:
> [snip]
> Ticket created under:
> https://svn.boost.org/trac/boost/ticket/12041
>
> Which brings me to another fusion question/improvement:
> ADT structs don't know their member names, which can be fixed with such a construct:
> #define ADT_MEMBER_NAME(CLASS, INDEX, MEMBER) \
> template <> struct struct_member_name<CLASS, INDEX> { typedef char const *type; static type call() { return #MEMBER; } };
>
> namespace boost { namespace fusion { namespace extension {
> ADT_MEMBER_NAME(ListEntry, 0, text)
> ...
> ADT_MEMBER_NAME(ListEntry, 6, published)
> } } }
>
> Could that be integrated into the BOOST_FUSION_ADAPT_STRUCT_ADT etc. macros?
>
> thanks,
>
> Jens Weller

Hi Jens,

I'm aware of this problem, as well for the name, as for detecting whether a proxy is in use or not.
Additionally the proxies objects are suboptimal, they were long wrongly implemented, in that that
 the Fusion user had to know by adapting an ADT the internal fusion proxy prefix :

https://github.com/boostorg/fusion/commit/b5018586aad1475652702a41d4f317f4494bdda9#diff-a3f59873f5b13add6772bf10300d9073L63

Since that point I wanted to bring better support for proxied member, and now you gave me the motivation
and the occasion.

I'll come up back soon with some fixes for this.
Cheers,

--
Damien Buhl (alias daminetreg)

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk