Hacker News new | ask | show | jobs
Nameof Operator for Modern C++ (github.com)
2 points by neargye 2651 days ago
1 comments

Header-only C++17 library provides nameof macros and functions to obtain simple name of variable, type, function, macro, and enum.

Before, you had to use string literals to refer to definitions, which is brittle when renaming code elements because tools do not know to check these string literals.

Try it online: https://wandbox.org/permlink/ffnImjrPVcZR2l5y