C++26 introduced reflection. Lieven de Cock demonstrates how to print information about class members using this new feature. C++ Reflection: a Universal Printer by Lieven de Cock From the article: The challenge of this article is to write a universal printer/formatter, so that we can format (nearly) any type we have.