auto arr = [1, 2, 3] should be a static array, not a GC allocated array
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Sun Jul 17 14:21:21 UTC 2022
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.
Btw, C++ achieves the same generically by deduction guides (or
improved type inference) so that you can write
```
using namespace std;
array a{1,2,3};
```
and get the type `array<int,3>`
More information about the Digitalmars-d
mailing list