On Saturday, 26 December 2015 at 13:28:31 UTC, TheDGuy wrote:
I get the error "value of 'this' is not known at compile time" which refers to the line where i create the int-array "space"
Why is it not possible to use it there?

Just for future newcomers, the answer for the above was given here:
http://forum.dlang.org/post/tqvgmsluuhzzscbxh...@forum.dlang.org

By Adam D. Ruppe:

"
Try:

auto arr = new int[](size.width*size.height*3+1);

The int[x] syntax declares a statically sized array - statically sized meaning it must be known at compile time and thus cannot be variables, along a few other differences.

The new array syntax though returns one of variable size.
"

Bubba.

Reply via email to