[Issue 3483] Eliminate read-modify-write operations for enums

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 20 16:54:23 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3483



--- Comment #3 from Andrei Alexandrescu <andrei at metalanguage.com> 2009-11-20 16:54:22 PST ---
(In reply to comment #2)
> Moreover, "next value" is a perfectly valid concept for enums, so I don't get
> why you want ++/-- removed at all.

It would be just too odd and requiring a lot of complication to define
properly. 

enum E { a = 5, b = 8, c = 15; }

Increment of an enum really becomes a series of if/else statements (if it's 5
make it 8 etc.) or would just increment the actual value leading to values that
are not part of the enum. What to do? Then what do you do when you are at the
end of the scale and want to increment?

Answers could be found, the problem is that reasonable people may think
different answers are best, and expect different behaviors.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list