On Wednesday, 19 March 2014 at 04:10:21 UTC, Meta wrote:
On Wednesday, 19 March 2014 at 01:56:35 UTC, Rikki Cattermole
wrote:
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 will create a new associative array at runtime wherever aa
is used, rather than creating only one instance at compile time
and referring to it wherever aa is used. This is also the case
with normal arrays, and possibly objects... I can't remember.
Okay, well I learnt something.