On Saturday, 6 January 2018 at 23:17:53 UTC, Ali Çehreli wrote:
So, apparently a[] * 2 is not an expression in D.
The reason must be for performance. If a[]*2 were an expression, the runtime would have to allocate memory and put the results there. Assigning that memory then to b[] would require an additional copy. Current rule puts the burden on the programmer to find the memory. No need to allocate if there's memory already.
That makes sense, thanks!