Compile-time associative array
Steven Schveighoffer
schveiguy at gmail.com
Tue Mar 19 23:41:58 UTC 2019
On 3/19/19 7:22 PM, Bastiaan Veelo wrote:
> Beware that a CT AA stores its elements in a different order than a RT
> AA, which you would notice in a foreach, for example.
Yes, this is the issue -- the runtime AA depends on druntime, which is
not available to the compiler. The compiler has its own AA
implementation that it uses for CTFE.
The internals will not be the same, which is why you can't construct one
at compile-time and use it at runtime (the enum just recreates it at
runtime when used).
-Steve
More information about the Digitalmars-d-learn
mailing list