enum conversions
Andrej Mitrovic
andrej.mitrovich at gmail.com
Fri May 13 14:41:19 PDT 2011
Well I don't know about safety, but this will throw an exception at
runtime on invalid enum values, and it also seems to perform a little
better than your original classifyNumber function (The
classifyNumberNewImpl function is the new one):
http://codepad.org/qyUaD1Hj
I'm not sure what is making the code faster, but on my machine I get:
classifyNumberNew: 5543
classifyNumberOld: 5550
More information about the Digitalmars-d
mailing list