auto arr = [1, 2, 3] should be a static array, not a GC allocated array
ryuukk_
ryuukk.dev at gmail.com
Sun Jul 17 14:46:14 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.
>
> 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>`
That's why i will never use C++, ever, and the reason i went with
D instead, coming from C
More information about the Digitalmars-d
mailing list