auto arr = [1, 2, 3] should be a static array, not a GC allocated array
Mike Parker
aldacron at gmail.com
Sun Jul 17 14:38:19 UTC 2022
On Sunday, 17 July 2022 at 14:21:21 UTC, Ola Fosheim Grøstad
wrote:
> On Sunday, 17 July 2022 at 09:23:23 UTC, Mike Parker wrote:
>> `int[$]` is a sensible syntax for it. So I hope someone does
>> pick this up one day and manages to convince the right people
>> that it's worth the implementation.
>
> If adding better inference is a point then choose a syntax that
> is more universal so that you don't end up with many different
> syntaxes for the same kind of "fill in blank" type deduction.
`$` already has an association with array length, though in `a =
[0 .. $]`. I think it's perfect for this case.
More information about the Digitalmars-d
mailing list