Array init

bearophile bearophileHUGS at lycos.com
Mon Aug 31 04:51:02 PDT 2009


A question about D1 specs (that may be useful for LDC).

In the following code there's anarray of structs S. Is it OK, according to D1 specs, to not initialize the memory of this array if the compiler sees that all fields of S have a void init?

struct S { double x = void, y = void; }
void main() {
  auto a = new S[1000];
}

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list