@@ -808,12 +808,12 @@ $(GNAME StaticConstructor):
808
808
$(P Static constructors are used to initialize static class members with
809
809
values that cannot be computed at compile time.)
810
810
811
- $(P Static constructors in other languages are built implicitly by using
811
+ $(PANEL
812
+ Static constructors in other languages are built implicitly by using
812
813
member
813
814
initializers that can't be computed at compile time. The trouble with
814
815
this stems from not
815
816
having good control over exactly when the code is executed, for example:
816
- )
817
817
818
818
------
819
819
class Foo
@@ -823,9 +823,9 @@ class Foo
823
823
}
824
824
------
825
825
826
- What values do a and b end up with, what order are the initializations
826
+ What values do `a` and `b` end up with, what order are the initializations
827
827
executed in, what
828
- are the values of a and b before the initializations are run, is this a
828
+ are the values of `a` and `b` before the initializations are run, is this a
829
829
compile error, or is this
830
830
a runtime error? Additional confusion comes from it not being obvious if
831
831
an initializer is
@@ -854,6 +854,7 @@ class Foo
854
854
}
855
855
}
856
856
------
857
+ )
857
858
858
859
$(P If $(D main()) or the thread returns normally, (does not throw an
859
860
exception), the static destructor is added to the list of functions to be called
@@ -878,7 +879,7 @@ $(P Static constructors have empty parameter lists.)
878
879
class Foo
879
880
{
880
881
static this() { ... } // a static constructor
881
- static private this() { ... } // not a static constructor
882
+ static private this() { ... } // Error: not a static constructor
882
883
static
883
884
{
884
885
this() { ... } // not a static constructor
0 commit comments