How to make a global immutable associative array?
Dicebot
public at dicebot.lv
Wed Mar 19 02:12:51 PDT 2014
On Wednesday, 19 March 2014 at 02:52:23 UTC, bearophile wrote:
> Rikki Cattermole:
>
>> Is an enum not appropriate? Because it can be used to push
>> constants and available at ctfe.
>>
>> enum int[int] aa = [1: 2, 3: 4];
>> pragma(msg, aa);
>
> This is bad from an efficiency point of view. I think Don even
> suggested to disallow it.
>
> Bye,
> bearophile
It still only existing way to define compile-time usable AA
value, disallowing it without fixing alternatives is not an
option.
More information about the Digitalmars-d
mailing list