static array literal syntax request: auto x=[1,2,3]S;

Timon Gehr timon.gehr at gmx.ch
Sun Jun 10 16:35:41 PDT 2012


On 06/11/2012 12:28 AM, Mehrdad wrote:
> Ugh... you keep on saying "on occasion" and "particular case", making it
> seem like it's such a rarity that it's not worth mentioning.
>
>
>
> Regarding your examples: the rule is quite simple:
>
> - Literals are static by default
> - If they are to be assigned to a dynamic array, then make them dynamic
> instead
>
>
>
> But I really don't understand what benefit you get by making them
> dynamic by DEFAULT... and your answer didn't tell me anything, other
> than "most of the time you're assigning them to dynamic arrays" (which
> tells me nothing about the benefits).

Type deduction.


More information about the Digitalmars-d mailing list