mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 12:44:42 +03:00
invalid enums
This commit is contained in:
@@ -7512,8 +7512,8 @@ The default gives a consecutive set of values that is good for `switch`-statemen
|
|||||||
##### Example
|
##### Example
|
||||||
|
|
||||||
enum class Col1 { red, yellow, blue };
|
enum class Col1 { red, yellow, blue };
|
||||||
enum class Col2 { red = 1, red = 2, blue = 2 }; // typo
|
enum class Col2 { red = 1, yellow = 2, blue = 2 }; // typo
|
||||||
enum class Month { jan = 1, feb, mar, apr, mar, jun,
|
enum class Month { jan = 1, feb, mar, apr, may, jun,
|
||||||
jul, august, sep, oct, nov, dec }; // starting with 1 is conventional
|
jul, august, sep, oct, nov, dec }; // starting with 1 is conventional
|
||||||
enum class Base_flag { dec = 1, oct = dec << 1, hex = dec << 2 }; // set of bits
|
enum class Base_flag { dec = 1, oct = dec << 1, hex = dec << 2 }; // set of bits
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user