Static Associative Array

Jonathan M Davis jmdavisProg at gmx.com
Sun Mar 6 18:21:27 PST 2011


On Sunday 06 March 2011 17:54:22 Andrej Mitrovic wrote:
> Fucking magnets^H^H^H^H^H^H^H enums, how do they work?
> 
> Everything should be evaluable at compile-time. Everything! It's all
> binary code anyway.

??? No... There are plenty of functions which legitimately _require_ that your 
program actually be running and using the results of such functions during 
compile time would be _bad_. For instance, asking what the number of CPU's on 
the current machine is or what the local time zone is. So, no, _not_ everything 
should be evaluatable at compile time - or at least, not everything should be 
evaluated at compile time.

Now, there _is_ a lot which is not currently usable with CTFE which _should_ be 
usable with CTFE. Most of this relates to memory (like classes). _Eventually_, 
pretty much everything in SafeD is supposed to be able to be used with CTFE, but 
that's likely to take a fair bit of time and effort, and that time and effort is 
currently going elsewhere (like 64-bit dmd). So, it'll happen eventually, but 
for now, we just have to deal with it.

- Jonathan m Davis


More information about the Digitalmars-d-learn mailing list