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.
88098809 void Print_color(int color);
88108810
88118811 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 };
88138813
88148814 Web_color webby = Web_color::blue;
88158815
88168816 // Clearly at least one of these calls is buggy.
88178817 Print_color(webby);
8818- Print_color(Product_info::Blue );
8818+ Print_color(Product_info::blue );
88198819
88208820Instead use an `enum class`:
88218821
@@ -8826,7 +8826,7 @@ Instead use an `enum class`:
88268826
88278827 Web_color webby = Web_color::blue;
88288828 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.
88308830
88318831##### Enforcement
88328832
You can’t perform that action at this time.
0 commit comments