Opened 9 years ago

Closed 8 years ago

#9516 closed Bugs (fixed)

Version of ADAPT_STRUCT that does not require specifying the types of the fields

Reported by: Nathan Ridge Owned by: Joel de Guzman
Milestone: To Be Determined Component: fusion
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

BOOST_FUSION_ADAPT_STRUCT requires repeating the types of the fields of the structure being adapted, as well as their names.

With C++11 decltype and its C++03 emulation BOOST_TYPEOF, we can eliminate the need to repeat the types.

See http://thread.gmane.org/gmane.comp.lib.boost.devel/247607 for a proposal.

Change History (6)

comment:1 by Damien Buhl (alias daminetreg) <damien.buhl@…>, 9 years ago

Thanks Nathan for creating the ticket. ;)

Here is the link to the Boost.Fusion fork where I'm preparing the pull-request to add this feature : github.com/daminetreg/fusion

Cheers

comment:2 by Joel de Guzman, 9 years ago

Since you have the momentum going, it would be great to finally clean up all the macros into something better structured (cleaner code). What do you think?

comment:3 by Damien Buhl (alias daminetreg) <damien.buhl@…>, 9 years ago

What do you mean by cleaning, do you see something specific that could improve the existing macros ? I don't see so much obvious things that could be made cleaner, but I'm probably blind. :)

The first Idea that comes to me is that I could add the type detection to the detail/adapt_base.hpp macros, instead of building on top of the existing macros as my first implementation does.

I think I should do it in 2 steps : first bringing the BOOST_FUSION_AUTO_* versions of the macros and adapting the tests and then I could begin with refactoring the existing macros.

comment:4 by Damien Buhl (alias daminetreg) <damien.buhl@…>, 9 years ago

Just for reference, the pull-request which contains the patch for this issue is available on github at : https://github.com/boostorg/fusion/pull/3

comment:5 by Joel de Guzman, 8 years ago

I guess we can close this now.

comment:6 by Joel de Guzman, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.