[Issue 6421] Require initialization of static arrays with array literals not to allocate
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon May 5 04:35:57 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=6421
--- Comment #14 from bearophile_hugs at eml.cc ---
(In reply to Kenji Hara from comment #6)
> I think this is the most better definition about the issue.
>
> "If an array literal could be deduced as static array, and it won't escape
> from its context, it would be allocated on stack."
This rule should become part of the D language, so all conformant D compilers
should respect it. So the functions that contain such cases can become @nogc.
(By they way "most better" is better written as "best".)
--
More information about the Digitalmars-d-bugs
mailing list