classInit

Returns the class's initializer instance. Returns null if all class fields are zero. Can be used to get the value of class fields' initial values.

immutable(T)
classInit
(
T
)
()
if (
is(T == class)
)

Examples

class C { int n = 42; }
assert(classInit!C.n == 42);

Meta