Static initialization of rectangular arrays
Les De Ridder
les at lesderid.net
Thu Aug 29 18:11:50 UTC 2019
On Thursday, 29 August 2019 at 15:10:26 UTC, rombankzero wrote:
> Is this a bug, or am I missing something? It would be really
> convenient to be able to statically initialize rectangular
> arrays in this way. Example: I have a struct that has a member
> that's a rectangular float array, but I have no way of telling
> the compiler that I want it default-initialized to all-zeroes
> (instead of NaNs)!
It's a known bug.
As a workaround you could use a `static this()`:
static double matrix;
matrix = 0;
More information about the Digitalmars-d-learn