Appending static arrays

Nordlöw via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 17 11:38:16 PDT 2017


On Monday, 17 July 2017 at 17:46:42 UTC, ag0aep6g wrote:
>     int[n + m] result = a ~ b;

Further, the expression `a ~ b` here will allocate and create a 
copy on the GC-heap before writing `result`.

Maybe LDC optimizes away this now or in the future but DMD cannot.

Yeah I know, kind of dumb but that's how it is currently.


More information about the Digitalmars-d-learn mailing list