Boost logo

Boost :

From: Samuel DEBIONNE (samuel.debionne_at_[hidden])
Date: 2021-03-09 16:35:16


> Please provide in your review information you think is valuable to
> understand your choice to ACCEPT or REJECT including Describe as a
> Boost library. Please be explicit about your decision (ACCEPT or REJECT).

ACCEPT! Thank you Peter for submitting this library.

> Some other questions you might want to consider answering:
> - What is your evaluation of the implementation?

TBH, I did not look at the code much, I expect a lot of preprocessor
machinery to generate the metadata.

> - What is your evaluation of the documentation?

Clean and to the point. Maybe the section "Describing Class Types" could
be split in "Describing Class Types" and "Reflecting Class Types" (usage
of the description)?

Nitpick: the code snippets are missing syntax highlighting.

> - What is your evaluation of the potential usefulness of the library?

Definitely useful. I see a bright future for this library especially if
it makes it to the standard. I am not sure how compatible it is with the
C++ Reflection TS though. Baby steps is probably the right approach for
such a complex feature...

> - Did you try to use the library? With which compiler(s)? Did you
> have any problems?

GCC 9.3 on Linux. I am not sure if the examples are integrated to the
build system yet but compiling them was a no-brainer.

> - How much effort did you put into your evaluation? A glance? A quick
> reading? In-depth study?

About two hours, playing with the examples and writing my owns.

Like many previous reviewers, I got tricked with the modifiers of the
class describer. The | operator might be a bit misleading because some
modifiers (mod_function) actually reduce the scope of the description.

Reflecting the name of the type would be a nice addition.

I am not a big fan of the BOOST_DEFINE_*** macros -actually shouldn't
they be BOOST_DESCRIBE_DEFINE_ENUM? But since we have definition macros
for enums, for symmetry, how about definition macros for structures
-Hana has BOOST_HANA_DEFINE_STRUCT?

I wonder if "fixed enum" is a standard terminology?

> - Are you knowledgeable about the problem domain?

Just from a user perspective.

I use Boost.Hana[1] to get some level of reflection on structures. This
solution is more limited than the one proposed in Boost.Describe (e.g.
does not support member functions out of the box). The scope of
Boost.Hana is much larger though and reflection is more a side effect of
the Struct concept than a goal of the library.

I use Better Enums[2] to get reflection on enums. Magic Enum C++[3] is a
more modern alternative. Both libraries offer more features out of the
box (aka enum_to_string) but I understand that the purpose of Describe
is to "establish a standard way of providing these reflection abilities"
and the interface needs to remain minimal to be the common factor.

I have a patched Boost.Serialization that supports generic serialization
of Hana Struct, just to say that it's possible.

Thanks,
Samuel

1.
https://www.boost.org/doc/libs/1_61_0/libs/hana/doc/html/group__group-Struct.html
2. https://github.com/aantron/better-enums
3. https://github.com/Neargye/magic_enum


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