fix Enum.4

This commit is contained in:
Bjarne Stroustrup 2016-08-29 15:50:47 -04:00
parent 3ec8cfc5cc
commit 3ca23f1575

View File

@ -7656,14 +7656,14 @@ Convenience of use and avoidance of errors.
##### Example
enum Day { mon, tue, wed, thu, fri, sat, sun };
enum class Day { mon, tue, wed, thu, fri, sat, sun };
Day operator++(Day& d)
{
return d == sun ? mon : Day{++d};
return d == Day::sun ? Day::mon : Day{++d};
}
Day today = sat;
Day today = Day::sat;
Day tomorrow = ++today;
##### Enforcement