cost of enum-to-string: C++26 reflection vs the old ways
Summary
The article benchmarks three enum-to-string approaches in C++: reflection (C++26), enchantum, and an X-macro preprocessor approach. It shows that the major cost is the header <meta> included with reflection, not the reflection logic itself. It analyzes per-TU and project-wide costs, discusses PCH vs modules, and provides practical guidance for when to use reflection vs X-macros, especially in large codebases.