Yeah, you are right. My fault.

On Tue, Oct 10, 2017 at 4:47 PM, Adam D. Ruppe via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com> wrote:

> On Tuesday, 10 October 2017 at 14:42:15 UTC, Daniel Kozak wrote:
>
>> It will return dynamic array. it is same as:
>>
>> double[5] = [0,0,0,0,0]; // this is still dynamicaly allocated.
>>
>
> Not true here, the compiler knows it is going into a static array and puts
> the result directly in there. It handles literals.
>
> The range version though will allocate since the function doesn't know
> where its result ends up. It will CTFE though if the variable is static.
>

Reply via email to