百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

nameof

> DevOps
开源

对于现代 C++ 的运算符,只需获取变量、类型、函数、宏和枚举的名称

2.3K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

对于现代 C++ 的运算符,只需获取变量、类型、函数、宏和枚举的名称

Nameof C++

A header-only C++17 library that provides nameof macros and functions for obtaining the name of a variable, type, function, macro, or enum.

Documentation

  • Reference
  • Limitations
  • Custom names
  • Integration

Features & Examples

  • Nameof
…
  • Nameof enum
…
  • Nameof type

    Exact type spellings are compiler-specific.

…

Integration

  • 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.
    )
    

Compiler compatibility

nameof requires C++17 or newer and supports:

  • Clang/LLVM >= 5
  • GCC >= 9
  • Visual Studio >= 2017

See the reference for feature-specific requirements.

Licensed under the MIT License

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •Reference
  • •Limitations
  • •Custom names
  • •Integration
  • •Nameof enum
  • •Nameof type
  • •Single header: add nameof.hpp to your project.
  • •CMake package:
  • •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.

> 标签

C++c-plus-plusc-plus-plus-17cpluspluscplusplus-17

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理