auto arr = [1, 2, 3] should be a static array, not a GC allocated array

Salih Dincer salihdb at hotmail.com
Sat Jul 23 15:00:20 UTC 2022


On Saturday, 23 July 2022 at 14:56:48 UTC, Don Allen wrote:
> Personally, I hope Walter ignores this conversation. I think 
> the current syntactic distinction (presence or absence of a 
> constant length) between static and dynamic arrays is fine and 
> whether a dynamic array is gc-allocated or stack-allocated 
> seems to me to be a compiler optimization issue. I would think 
> that if the compiler can prove that the array doesn't need to 
> be re-allocated due to expansion  [...]

I think Walter will give us a satisfactory explanation on this.

SDB at 79




More information about the Digitalmars-d mailing list