Boost logo

Boost :

From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2021-03-02 13:48:00


Hi Everyone (but mainly Peter),
Boost.Spirit needs to have an index-based access to user defined types, as
explained in the tutorial:
https://www.boost.org/doc/libs/1_75_0/libs/spirit/doc/x3/html/spirit_x3/tutorials/employee.html
Currently Boost.Spirit uses the interface of Boost.Fusion, and users are
encouraged to use macros like BOOST_FUSION_ADAPT_STRUCT:
https://www.boost.org/doc/libs/1_75_0/libs/fusion/doc/html/fusion/adapted/adapt_struct.html

The first question is, can Boost.Describe's interface be plugged into
Boost.Spirit?
It is not that obvious to me for a couple of reasons. For instance, it
would require an interface in Boost.Describe for answering the question,
"has describe::members been specialized for type X"?

The second question is, can is Boost.Describe capable of replacing the
adapter macros in Boost.Fusion?
For instance, Boost.Fusion allows the users to define and adapt a user
defined type with one macro:
https://www.boost.org/doc/libs/1_75_0/libs/fusion/doc/html/fusion/adapted/define_struct.html

This is similar in concept to what macro BOOST_DEFINE_ENUM does for enums.
What is the motivation behind allowing the definition of enums in this way
but not classes (at least the aggregate classes).

My general observation is that we have a number of libraries with
overlapping goals:
Boost.Describe,
Boost.PFR,
Boost.Fusion (the part for adapting UDTs)

Maybe it is ok, but does it mean that there are so many incompatible use
cases? Maybe there is a way to reduce this number.

Regards,
&rzej;


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