File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -8809,13 +8809,13 @@ To minimize surprises: traditional enums convert to int too readily.
8809
8809
void Print_color(int color);
8810
8810
8811
8811
enum Web_color { red = 0xFF0000, green = 0x00FF00, blue = 0x0000FF };
8812
- enum Product_info { Red = 0, Purple = 1, Blue = 2 };
8812
+ enum Product_info { red = 0, purple = 1, blue = 2 };
8813
8813
8814
8814
Web_color webby = Web_color::blue;
8815
8815
8816
8816
// Clearly at least one of these calls is buggy.
8817
8817
Print_color(webby);
8818
- Print_color(Product_info::Blue );
8818
+ Print_color(Product_info::blue );
8819
8819
8820
8820
Instead use an `enum class`:
8821
8821
@@ -8826,7 +8826,7 @@ Instead use an `enum class`:
8826
8826
8827
8827
Web_color webby = Web_color::blue;
8828
8828
Print_color(webby); // Error: cannot convert Web_color to int.
8829
- Print_color(Product_info::Red ); // Error: cannot convert Product_info to int.
8829
+ Print_color(Product_info::red ); // Error: cannot convert Product_info to int.
8830
8830
8831
8831
##### Enforcement
8832
8832
You can’t perform that action at this time.
0 commit comments