File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -361,9 +361,13 @@ $(SPEC_RUNNABLE_EXAMPLE_RUN
361361
362362$(H2 $(LNAME2 static_initialization, Static Initialization of AAs))
363363
364- NOTE: Not yet implemented.
364+ NOTE: Static initialization, e.g. assigning an AA value to a global or
365+ static variable, isn't implemented yet. AAs can be constructed and used
366+ at runtime and at compile time as usual. Pre-computed AA values embedded
367+ into the executable are however not yet possible.
365368
366369 ---------
370+ // in global scope
367371 immutable long[string] aa = [
368372 "foo": 5,
369373 "bar": 10,
@@ -378,6 +382,11 @@ $(H2 $(LNAME2 static_initialization, Static Initialization of AAs))
378382 }
379383 ---------
380384
385+ As a workaround you can use
386+ $(LINK2 spec/module.html#staticorder, static constructors) or
387+ $(LINK2 spec/pragma.html#crtctor, CRT constructors) to initialize global
388+ AAs immediately at program startup.
389+
381390$(H2 $(LNAME2 runtime_initialization, Runtime Initialization of Immutable AAs))
382391
383392 $(P Immutable associative arrays are often desirable, but sometimes
You can’t perform that action at this time.
0 commit comments