switch with enum
anonymous via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Nov 25 12:47:35 PST 2015
On 25.11.2015 21:06, Meta wrote:
> ...Which doesn't work because it won't compile without a default case.
> Is this a recent change? I don't remember D doing this before.
Use `final switch`. Ordinary `switch`es need an explicit default case.
`final switch`es have to cover all possibilities individually. Implicit
default cases are not allowed.
More information about the Digitalmars-d-learn
mailing list