mirror of
https://github.com/aantron/better-enums.git
synced 2025-12-06 16:56:42 +08:00
Each Better Enum now has an internal enum class type to which it is convertible, instead of being convertible to the regular enum that defines its constants. switch statements are compiled at the enum class type. This comes at the price of the user having to type +Enum::Constant instead of Enum::Constant in cases, in order to trigger an explicit promotion of the pre-C++11 enum to Better Enum, so it can then be implicitly converted to the enum class. The remaining "hole" is that direct references to constants (Enum::Constant) are still implicitly convertible to integral types, because they have naked pre-C++11 enum type. |
||
|---|---|---|
| .. | ||
| 1-basic.cc | ||
| 2-iterate.cc | ||
| 3-switch.cc | ||
| 4-constexpr.cc | ||
| 5-containers.cc | ||
| 6-traits.cc | ||
| 7-bitset.cc | ||
| 8-constexpr-iterate.cc | ||
| Makefile | ||