<div dir="ltr">Yeah, you are right. My fault.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 10, 2017 at 4:47 PM, Adam D. Ruppe via Digitalmars-d-learn <span dir="ltr"><<a href="mailto:digitalmars-d-learn@puremagic.com" target="_blank">digitalmars-d-learn@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tuesday, 10 October 2017 at 14:42:15 UTC, Daniel Kozak wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It will return dynamic array. it is same as:<br>
<br>
double[5] = [0,0,0,0,0]; // this is still dynamicaly allocated.<br>
</blockquote>
<br></span>
Not true here, the compiler knows it is going into a static array and puts the result directly in there. It handles literals.<br>
<br>
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.<br>
</blockquote></div><br></div>