final switch and straight integers

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 19 23:36:01 PDT 2016


Dominikus Dittes Scherkl:

> final switch makes no sense on things that are not enumerated. 
> Even on ubyte almost nobody will ever list all 256 cases, not 
> to mention larger types.

It's easy to cover all the values in a switch, using ranges. No 
need to forbid final switch for integral values. It just needs to 
be implemented correctly.

Bye,
bearophile


More information about the Digitalmars-d mailing list