Closed Sawyer47 closed 5 years ago
I wonder if we should consider this a bug instead.
Hi and thanks for reporting.
I agree that it is not clear from the documentation that the type of enum_scoped::a
is not enum_scoped
, but enum_scoped::type
which of course is an enumeration.
Your patch is welcome, and I suggest it is merged as soon as boost 1.64 is delivered.
It could be possible to define constants a
and b
of type enum_scoped
(with a different macro syntax), but these constants couldn't be used in the switch/case.
I don't know how to have enumerators and constants with the same name.
I don't know which names should be used for them; a for the enumerator and a_ for the class instance?
I agree the workaround enum_scoped(enum_scoped::a)
is cumbersome, but it works.
I've opted for this partial solution as the more convenient.
I don't think this is a bug we can fix without adding other macros.
Hi, just passing by and wondering why the PR was not accepted after all?
Good question. Any objections to merging it?
I recently stumbled upon a case in which scoped enums have different behaviors in C++03 and C++11. I thought it would be a good idea to document this case.