On Sunday, 7 June 2015 at 12:30:12 UTC, Dennis Ritchie wrote:
Does D the ability to add items to arrays and hashes at compile time?

For example, how do I do it in compile time?:

int[][int][int] hash;

hash[4][6] ~= [34, 65];
hash[5][7] ~= [4, 78, 21];

try using a pure function + static e.g.

 int[][int][int] somePureDefaultHash() pure
{
    ... //initialise it here
}

...
static hash = somePureDefaultHash();

Reply via email to