Better Enums is a single header file that causes your compiler to generate *reflective* enum types. This makes it easy to translate between enums and strings, and much more. Here's how to use a Better Enum:
enable

declare


parse
print


count
iterate



switch






safe cast


at compile time
#include <enum.h>

ENUM(Channel, int, Red = 1, Green, Blue)


Channel     c = Channel::_from_string("Red");
const char  *s = c._to_string();


size_t      n = Channel::_size;
for (Channel c : Channel::_values())
    run_some_function(c);


switch (c) {
    case Channel::Red:    // ...
    case Channel::Green:  // ...
    case Channel::Blue:   // ...
}


Channel     c = Channel::_from_integral(3);


constexpr Channel c = Channel::_from_string("Blue");
### What do you get?
### It's what built-in enums ought to do. The library notionally extends $cxx, adding oft-needed features.
### Resources
%% title = Clean reflective enums for C++ %% description = Reflective enums for C++ with clean syntax, in a header-only library. Can be converted to strings, iterated, counted, and used for metaprogramming. Free under the BSD license. %% class = index