'static' keyword for positional array initialization

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Wed Aug 12 00:42:23 PDT 2009


Ali Cehreli wrote:
> The 'static' keyword is required by dmd 2.031 for the second of these two definitions:
> 
>   int[2] static_0 = [ 1, 1 ];
>   static int[2] static_1 = [ 1:1 ];
> 
> Is this inconsistency by design? Should 'static' be required for both or neither?
> 
> Ali
> 


I've tried with DMD 2.031, and I can't reproduce this. This works fine 
for me:

   int[2] static_0 = [ 1, 1 ]:
   int[2] static_1 = [ 1:1 ];

Where did you put the declarations? I've tried putting them at both 
module level and in a class, and both times it compiled without problems.

-Lars


More information about the Digitalmars-d-learn mailing list