May 31, 2011 A switch bug | ||||
|---|---|---|---|---|
| ||||
In this case I have not appreciated implicit char <-> int conversions in D (this comes from a bug of mine):
void main(string[] args) {
foreach (c; args[1])
switch (c) {
case 0: .. case 9: // do something with the digit
default:
}
}
Bye,
bearophile
| ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply