Answer
C++ has no built-in enum reflection before C++26 proposals, so enum-to-string is done manually (switch or a map), by code generation (X-macros), or with libraries like magic_enum (which use compile-time tricks). This is a common pain point; the standard approaches are a switch returning literals or a lookup table.
const char* name(Color c){
switch(c){ case Color::Red: return "Red"; default: return "?"; }
}Real-world example A logging system maps enum values to names via a switch so logs are human-readable.