Boost logo

Boost :

Subject: [boost] [Better Enums] More complete release - feedback requested
From: Anton Bachin (antonbachin_at_[hidden])
Date: 2015-06-05 23:21:49


Hello,

I posted to the mailing list some weeks ago concerning a reflective enum
library. I’ve since done a lot of work and made a new release. I’d like to get
feedback from anyone that is interested.

The library can be found at: https://github.com/aantron/better-enums

At the risk of repeating myself, let me summarize for those who didn’t read the
original thread: the library generates reflective enums that support string
conversion and iteration, but with a nicer syntax than seen to date. Also,
in C++11, the reflective capabilities are accessible at compile time.

Since the original thread, I have made the library work with C++98 with the
variadic macro extension, tested it thoroughly on clang, gcc, and msvc, rewrote
the documentation, and made the interface (potentially) completely constexpr.
The reason I say potentially is that there is one slow feature, which is
disabled by default, but can be opted into easily.

There is a tutorial starting here:
http://aantron.github.io/better-enums/tutorial/HelloWorld.html

and a few examples of “advanced” usage, the most interesting one of which I
think is:
http://aantron.github.io/better-enums/demo/SpecialValues.html

(Thanks to Gottlob Frege for making a suggestion, which I adapted to improve
this example.)

I’d like to take this as far as possible towards solving the problems with C++
enum maintainability, and providing improved enum types that are as near to
first-class as possible. I would be very happy if you just tried this out and
let me know what you think and what problems you ran into.

Thank you,
Anton


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk