Skip to content

Commit eebc0b6

Browse files
authored
Update pragma(crt_constructor) documentation
... to highlight the fact that it can initialize const/immutable variables.
1 parent 6df48f1 commit eebc0b6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spec/pragma.dd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ $(H3 $(LNAME2 crtctor, $(D pragma crt_constructor)))
115115
$(P Annotating a struct or class definition does not affect the members of
116116
the aggregate.)
117117

118+
$(P A function that is annotated with `pragma(crt_constructor)` may initialize
119+
`const` or `immutable` variables.)
120+
118121
$(BEST_PRACTICE Use for system programming and interfacing with C/C++,
119122
for example to allow for initialization of the runtime when loading a DSO,
120123
or as a simple replacement for `shared static this` in

0 commit comments

Comments
 (0)