Initializing a fixed sized array

finalpatch fengli at gmail.com
Fri May 31 23:34:37 PDT 2013


Oh cool, good to know this has been fixed. You are right, I just 
verified with DMD 2.063 and the generated code was good! Sorry 
about the noise.

On Saturday, 1 June 2013 at 06:28:45 UTC, Jonathan M Davis wrote:
> Are you sure that that still allocates? I thought that that had 
> been fixed. If
> it hasn't, it will be. The issue is completely temporary and 
> not intended to
> be the case long term.
>
> Now, assuming that you're right and that still allocates, it's 
> trivial to
> create a variadic function to initialize it for you by 
> essentially generating
>
> int[3] x;
> x[0] = 1;
> x[1] = 2;
> x[2] = 3;
>
> for you. So, it's easy enough to get around, but the problem 
> should either
> already be fixed in the compiler, or if not, it will be at some 
> point in the
> near future.
>
> - Jonathan M Davis



More information about the Digitalmars-d mailing list