
10 Dec
2005
10 Dec
'05
3:45 p.m.
On 12/10/2005 09:09 AM, Yuval Ronen wrote:
Paul Mensonides wrote:
I haven't really been following this conversion, but why do you need an array at all? You have a sequence containing enumerator names. You can generate a switch statement just as easily as you can the enum itself: [snip] One point in favour of array, is that it ensures us of O(1) lookup time. A good compiler might do that with switch/case but I'm not sure it's something that we can rely on. [snip] Actually, Andy Little did a comparison which showed the switch was faster than the array:
http://groups.google.com/group/comp.lang.c++.moderated/msg/6de73412e552c387