...
Of these three options, the first — "provide no explicit integer assignments" — is the simplest, and consequently the preferred, approach unless the first enumerator must have non-zero value.
Exceptions
| Anchor |
|---|
| int09INT09-ex1EX1int09 |
|---|
| INT09-ex1EX1 |
|---|
|
INT09-EX1: In cases where defining an enumeration with two or more enumerators with the same value is intended the constant expression used to define the value of the duplicate enumerator should reference the enumerator rather than the original enumerators value. This makes the intent clear to both human readers of the code as well as automated code analysis tools that detect violations of this guideline and would diagnose them otherwise. Note, however, that this does not make it possible to use such enumerators in contexts where unique values are required (such as in a
switch statement as discussed above).
...