When will map/dict initialization be ready?

John Xu 728308756 at qq.com
Fri Apr 7 02:44:29 UTC 2023


On Thursday, 6 April 2023 at 02:49:55 UTC, Paul Backus wrote:
> To work around this limitation, you can initialize a global AA 
> using a [static module constructor][1]. For example:
>
>     long[string] globalAa;
>
>     static this()
>     {
>         globalAa = ["foo": 5, "bar": 10];
>     }
>
> This will perform the initialization at runtime, during program 
> startup (before calling `main`).

Ok, great, thanks. Better add to the online document.


More information about the Digitalmars-d mailing list