Advertisement
Guest User

Set array or variable from constructor

a guest
Mar 14th, 2015
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.82 KB | None | 0 0
  1. //code
  2. import std.stdio;
  3. /**
  4.  
  5. This is a 3D Model representation.
  6.  
  7. author: *****************@gmail.com
  8. */
  9. public class Model {
  10.    
  11.     private real[][][] array;
  12.    
  13.     this(ulong width, ulong height, ulong depth){
  14.         array = new real[width][height][depth];
  15.     }
  16. }
  17. // end code
  18.  
  19. //error:
  20. ************  Running DUB build  ************
  21. > dub build
  22. Building genesis3d ~master configuration "application", build type debug.
  23. Compiling using dmd...
  24. source\genesis3d\core\Model.d(13): Error: variable width cannot be read at compile time
  25. source\genesis3d\core\Model.d(13): Error: variable width cannot be read at compile time
  26. FAIL .dub\build\application-debug-windows-x86-dmd_2066-D0A4BE7D622326D497E72B3C1FB3A1FD\ genesis3d executable
  27. Error executing command build:
  28. dmd failed with exit code 1.
  29.   ^^^ Terminated, exit code: 2 ^^^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement