mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
invalid enums
This commit is contained in:
parent
b14fe453a4
commit
9160dbb818
|
@ -7512,8 +7512,8 @@ The default gives a consecutive set of values that is good for `switch`-statemen
|
|||
##### Example
|
||||
|
||||
enum class Col1 { red, yellow, blue };
|
||||
enum class Col2 { red = 1, red = 2, blue = 2 }; // typo
|
||||
enum class Month { jan = 1, feb, mar, apr, mar, jun,
|
||||
enum class Col2 { red = 1, yellow = 2, blue = 2 }; // typo
|
||||
enum class Month { jan = 1, feb, mar, apr, may, jun,
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user