Andrzej Krzemienski wrote:
I do not appreciate the BOOST_DEFINE_ macros for enumerations. We get as much as four of them, ...
We'll even get eight once the requested support for class-nested enums is added. :-)
and neither is able to handle the use case that I consider basic, which I often have in my code: where I omit value zero and start from 1:
struct Error { badSoething = 1, badSomethingElse, tooLongSomethng, ... };
So, I am not sure how many real life enums these macros cover.
They cover the common case of an enumeration without any initializers; the
case where you have a number of alternatives but don't care about their exact
numeric values. I do believe this is reasonably common, even if it's not
universal.
E.g. enum class Shape { Triangle, Rectangle, Circle }.
Further e.g.
template