On Friday, August 31, 2012 20:24:27 Philippe Sigaud wrote: > On Fri, Aug 31, 2012 at 7:04 PM, ixid <[email protected]> wrote: > > Thank you, that certainly makes sense. > > If you're certain you won't need to modify it, you can make it a > compile-time constant: > > enum int[string] dayNumbers = > [ "Monday" : 0, "Tuesday" : 1, "Wednesday" : 2, > "Thursday" : 3, "Friday" : 4, "Saturday" : 5, > "Sunday" : 6 ]; > > void main() { > //Stuff > }
Except that that allocates a new AA every time that you use dayNumbers. So, that's probably a bad idea. - Jonathan M Davis
