Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum
Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum
A header-only C++17 library that provides nameof macros and functions for obtaining the name of a variable, type, function, macro, or enum.
……Nameof type
Exact type spellings are compiler-specific.
…Single header: add nameof.hpp to your project.
CMake package:
find_package(nameof CONFIG REQUIRED)
target_link_libraries(your_target PRIVATE nameof::nameof)vcpkg: install the nameof package with vcpkg install nameof.
Conan: add nameof/x.y.z to the requires section, where x.y.z is the required release version.
AUR: install nameof with an AUR helper, for example yay -S nameof.
CPM:
CPMAddPackage(
NAME nameof
GITHUB_REPOSITORY Neargye/nameof
GIT_TAG vx.y.z # Replace `x.y.z` with the release version you want to use.
)nameof requires C++17 or newer and supports:
See the reference for feature-specific requirements.
No open issues yet, or sync has not completed.