|
Boost : |
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2021-03-10 21:13:32
Hi Everyone,
This is my review of the Boost.Describe library.
I recommend that the library should be **ACCEPTED** into Boost.
The goal of the library is clearly specified, and addresses real world
needs. The examples (JSON serialization, printing) are convincing, and the
number of reviews saying "I needed it for a while" reassure that it will be
useful.
The library is well designed. I mean the separation into macros declaring
the "reflection lsts", and then functions operating on those lists.
The documentation, in connection with the clear design, makes it easy to
learn and use the library. The only issues I had was with the modifiers
enum: I had to look into the implementation to understand how some values
work.
Regarding the implementation, I only had a superficial look. One thing I
observed is that the implementation is very short! When I tried to combine
all headers into one, in order to test it on WandBox, I discovered that it
is less than 600 lines. You can see it here:
https://wandbox.org/permlink/rkAtPCbAsqNzVRMV
The only issue I have is the names that start with the underscore that can
potentially end up in the global namespace, which by my reading of the C++
Standard is UB.
I have spent a couple of hours testing toy examples, reading the docs, and
looking at the implementation. I used GCC 9.2.0 on MinGW and GCC 10.1.0 on
WandBox. All worked fine.
Regarding my previous concerns about the "N+1" problem (an overlap with
other libraries), I no longer have it. Boost.Describe is for class and enum
authors to offer a reflection information for whoever wants it. A library
like Boost.Fusion is for working with fusion sequences. Only as
convenience, it provides a way to adapt a user defined class as a fusion
sequence, but if it wants, it can use Boost.Describe lists as an
alternative way of providing the adaptation.
My two real-life use cases for a reflection like this was:
1. Adapting aggregates for Boost.Spirit. It looks like even Boost.FPR would
do.
2. Printing and implementing swap() and hash() for my types. So far I had
to do it manually, so I am looking forward to having this library in Boost.
Finally, I would like to thank Peter for writing and sharing this library.
Regards,
&rzej;
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk