@@ -586,8 +586,10 @@ $(H2 $(LNAME2 override, $(D override) Attribute))
586
586
587
587
$(H2 $(LNAME2 static, $(D static) Attribute))
588
588
589
- $(P The $(D static) attribute applies to functions and data.
590
- It means that the declaration does not apply to a particular
589
+ $(P The $(D static) attribute applies to functions and data.)
590
+
591
+ $(P Inside an aggregate type, a `static`
592
+ declaration does not apply to a particular
591
593
instance of an object, but to the type of the object. In
592
594
other words, it means there is no $(D this) reference.
593
595
$(D static) is ignored when applied to other declarations.
@@ -610,14 +612,21 @@ f.foobar(); // produces 7;
610
612
---------------
611
613
612
614
$(P
613
- Static functions are never virtual.
615
+ Static functions are never $(DDSUBLINK spec/function, virtual-functions, virtual) .
614
616
)
615
617
$(P
616
618
Static data has one instance per thread, not one per object.
617
619
)
620
+ $(P A static $(DDSUBLINK spec/function, nested, nested function) cannot
621
+ access variables in the parent scope.)
622
+
623
+ $(P Inside a function, a $(DDSUBLINK spec/function, local-static-variables,
624
+ static local variable) persists after the function returns.)
625
+
618
626
$(P
619
627
Static does not have the additional C meaning of being local
620
- to a file. Use the $(D private) attribute in D to achieve that.
628
+ to a file. Use the $(RELATIVE_LINK2 VisibilityAttribute, `private`)
629
+ attribute in D to achieve that.
621
630
For example:
622
631
)
623
632
0 commit comments