This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Description
https://en.cppreference.com/w/cpp/language/enum#Scoped_enumerations
Scoped enums (enum class) fix several problems with traditional, unscoped enums. Most notably
- They do not implicitly convert to or from integer types
- They do not pollute the parent namespace with their constants by default
I notice the compiler currently hacks around the second issue with unscoped enums by defining a namespace for the enum. However, in my opinion, (1) is still worth addressing and it would be nice to have slightly cleaner generated headers.
Given that changing all enums to scoped enums would break existing code, I would suggest adding a flag for this behaviour when compiling C++, such as --scoped-enum.