# Neargye/nameof

Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum

Repository: https://github.com/Neargye/nameof
Canonical: https://ross.abutalabs.com/products/nameof
Language: C++
License: MIT
License Family: permissive
Topics: cplusplus, cplusplus-17, c-plus-plus, c-plus-plus-17, cpp, cpp17, nameof, nameof-operator, enum-to-string, serialization, reflection, metaprogramming, header-only, single-file, no-dependencies
Last push: 2026-08-05T16:48:54+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 96, release rhythm 79, longevity 100
- inputs: {"age_days": 3091, "days_push": 28, "days_rel": 60, "gap_med": 61, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2357, forks 126 (observed 2026-08-28T04:06:40.650574+00:00)

## What it is
A header-only C++17 library providing nameof macros and functions to obtain the name of variables, types, functions, macros, and enum values as strings. It is a single-file, dependency-free utility supporting enum-to-string conversion, including enum flags.

## Use cases
- convert enum values to strings in C++
- get the name of a variable or function as a string
- serialize enum flags to readable text
- obtain type names for logging or debugging
- add lightweight reflection-like name lookup to C++ code

## When to choose
- you need enum-to-string conversion without code generation
- you want a zero-dependency, header-only C++17 solution
- you need compile-time name retrieval for variables, types, or functions

## When to avoid
- you need full runtime reflection beyond name retrieval
- your project targets pre-C++17 compilers
- you need exact portable type spellings across all compilers

## Facets
- artifact type: library
- maturity: stable
- function: serialization, developer-tools
- domain: developer-tools, programming-languages, parsers
- platform: cpp, cross-platform
- tags: header-only, nameof, reflection, metaprogramming, enum-to-string, cpp17, no-dependencies

## Member repositories
- Neargye/nameof (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:40.650574+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:36:15.845936+00:00, confidence not recorded.
  - readme: https://github.com/Neargye/nameof (fetched 2026-08-28T04:06:40.650574+00:00, sha b45216ee6797)
- Data as of 2026-08-30T08:39:29.467469+00:00.
