C++ libraries which simplifies reflection

There are quite a few attempts in the C++ library world to simplify the creation of reflection. One example is the meta-programming library Boost Hana by Louis Dionne which gives classes reflection capabilities via a simple macro. Recently, Boost has also added the Precise and Flat reflection by Anthony Polukhin, which automatically reflects public content of classes, as long as all members are simple types.

However, for clarity, in this example we will only use our own reflect() member function.

Get C++ High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.