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.