Home

Awesome

Github releases Conan package Vcpkg package License Compiler explorer Stand With Ukraine

Nameof C++

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

If you like this project, please consider donating to one of the funds that help victims of the war in Ukraine: https://u24.gov.ua.

Documentation

Features & Examples

Remarks

Integration

You should add required file nameof.hpp.

If you are using vcpkg on your project for external dependencies, then you can use the nameof package.

If you are using Conan to manage your dependencies, merely add nameof/x.y.z to your conan's requires, where x.y.z is the release version you want to use.

Archlinux users can install nameof by package manager AUR, using the following command: yay -S nameof.

Alternatively, you can use something like CPM which is based on CMake's Fetch_Content module.

CPMAddPackage(
    NAME nameof
    GITHUB_REPOSITORY Neargye/nameof
    GIT_TAG x.y.z # Where `x.y.z` is the release version you want to use.
)

Compiler compatibility

Check in the reference for each features.

Licensed under the MIT License