Enums four ways
summary
Compares four concrete ways to get enum names and values: a boost preprocessor macro list that builds a constexpr string array (works fast and at compile time but requires contiguous values); a pretty function parser with static recursion that extracts identifiers (compiler- and namespace-dependent and needs an explicit enum count); a set of typed static value objects with explicit assignments; and a compile-time counter trick that auto-increments but forbids mixing explicit values — all viable but imperfect.
AI-written summary · about
chapters (6)
- 0:00Start
- 0:35Motivation
- 1:12Boost Preprocessor
- 2:14Pretty_Function
- 3:01Method 3 -Values as types
- 3:35Stateful Metaprogramming
related talks
06mLightning Talk: So You Thought C++ Was Weird? Meet Enums
55mC++14 Reflections Without Macros, Markup nor External Tooling..
53mFun with Flags - C++ Type-safe Bitwise Operations
01h 32mA Medley of C++
51mTypical C++, but Why?
01h 36mEmbracing User-Defined Literals Safely
01h 34mMetaprogramming in C++14
01h 11mKeynote: C++ Horizons
