title: Mapping enum values to strings in C++
body: <p>Is there a way to, at runtime, map the value of an enum to the name? (I'm building with GCC.)</p>
  
  <p>I know GDB can do it and I'm willing to use something that's unportable and mucks with debug data.</p>
  
  <hr>
  
  <p><em>Edit:</em> I'm looking for a solution that doesn't require modifying the original enum declaration nor hand copying all the values out in a mapping function. I already know how to do both of those.</p>
  
  <p>Effectively; I want a function that does whatever GDB does when it formats runtime enum values.</p>