The actual feature comes in C++26 (static reflection) but there are polyfills that allow to do it today (boost.pfr, https://github.com/qlibs/reflect) ; concepts are also a great help: https://cnrs.hal.science/hal-04090584/file/icmc2022template....