CTFE and assoc array

user1234 user12324 at 1234.de
Sun Jan 19 13:27:52 UTC 2020


On Sunday, 19 January 2020 at 13:02:18 UTC, Andrey wrote:
>> On Saturday, 18 January 2020 at 21:44:35 UTC, Boris Carvajal 
>> wrote:
>
> I read that thread. But:
>> Deprecation: initialization of immutable variable from static 
>> this is deprecated.
>> Use shared static this instead.
>
> And we get? No CTFE with static immutable AA?

The problem is that the code for AA consists of runtime hooks.
So in practice even if your keys and values are available the 
compiler doesn't know how to build it and use it.

At some point what could be done is a kind of serialization at 
compile time and facilities for quick deser at runtime from the 
data segment but that doesn't change the fact that they could 
still not be used for CTFE or template metaprog.


More information about the Digitalmars-d-learn mailing list