aantron/better-enums
C++ compile-time enum to string, iteration, in a single header file observed · 2026-08-28
Health v2 · maintenance only
23/100
- Activity 0
- Release rhythm 8
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 4132
- days_rel: n/a
- days_push: 935
- n_releases_24m: 0
Adoption not part of the score
1828 stars · 182 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
Better Enums is a single-header C++ library that adds reflection to enums, enabling string conversion, iteration, and counting at compile time (C++11) or runtime (C++98). It uses a macro-based metaprogram executed by the compiler with no dependencies or generator tools.
Use cases
- convert enum values to and from strings in C++
- iterate over all enum values
- parse a string into an enum safely
- count enum members at compile time
- use enums in constexpr functions and template metaprogramming
- replace unmaintainable enum-to-string switch statements
When to choose
- you need reflective enums in C++ without code generation tools
- you want a zero-dependency, header-only solution
- you need compile-time enum reflection in C++11
- you target freestanding or embedded environments (no heap, no exceptions)
When to avoid
- you need enums declared inside a class (macro limitation)
- you can use C++26 native reflection or a different enum approach
- you prefer non-macro-based enum libraries
Facets
library · maturity stable
serialization developer-tools developer-tools programming-languages parsers cpp cross-platform header-only enum reflection compile-time metaprogramming single-header
2 sources
- readme: https://github.com/aantron/better-enums · fetched 2026-08-28 · 7f73ec10c3a2
- homepage: http://aantron.github.io/better-enums · fetched 2026-08-29 · 54dbee744a70
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| aantron/better-enums | main | 23 |
For agents
markdown · JSON · MCP: product_card(name="aantron/better-enums")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem