When is a dynamic array really a static array?

Steven Schveighoffer schveiguy at gmail.com
Mon Dec 30 17:50:06 UTC 2019


On 12/30/19 11:14 AM, Eugene Wissner wrote:
> On Monday, 30 December 2019 at 15:39:00 UTC, Steven Schveighoffer wrote:
>> Note that doing this:
>>
>> auto y = x[];
>> foo(y);
>>
>> does print dynamic as I expected.
> 
> You can work around with an assignment:
> 
> void main()
> {
>      ubyte[16] x;
>      foo(x);
>      auto y = x[];
>      foo(y);
> }

GMTA ;)

-Steve


More information about the Digitalmars-d mailing list