For example,
- https://www.boost.org/doc/libs/latest/doc/html/boost_pfr.htm...
- https://github.com/getml/reflect-cpp
And kudos for using modern C++.
In general I’ve found it’s much better in C++ to be verbose and plain rather than succinct and elegant.
Javascript and python lack typing so being pithy&clever in those languages has entirely different implications than in C++.
“How can I express this in the most basic, unsurprising and plainspoken C++” is usually the right question to ask. “How can I make this more elegant” is a question better suited for other languages imho.
The best C++ API when in doubt is a C style API.