[Issue 5714] case ranges in final switches

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 2 06:34:38 PST 2012


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



--- Comment #3 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2012-12-02 06:34:36 PST ---
(In reply to comment #2)
> (In reply to comment #1)
> 
> > So a final switch would only work on byte-types. I'm not sure if Walter would
> > like a feature that only works with one fundamental type.
> 
> There are also chars, and ubytes.

They have the same range so it doesn't matter what you call them, the range is
limited to 0 .. 255.

> You can't have a default in static switches.

Yes, you would use a normal switch for that. But you could have a helper
template mixin that could error internally if you don't provide all the cases,
which is a workaround for final switches not providing case ranges.

-- 
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