Automatic Inference for Both Key and Value Types of an Associative Array
Meta via Digitalmars-d
digitalmars-d at puremagic.com
Thu Aug 14 11:14:16 PDT 2014
On Thursday, 14 August 2014 at 18:07:57 UTC, bearophile wrote:
> Meta:
>
>> Isn't that also the case for the auto*, const[], immutable[$],
>> etc. syntax? Conceptually it feels the same to me as Kenji's
>> enhancement; I don't know enough about the compiler to talk
>> about it technically.
>
> One difference between Kenji's enhancement and the AA type
> inference is that arr[$] length inference for arrays is useful
> in many situations and it helps avoid some bugs and make the
> code more DRY. So it's a different degree of usefulness.
>
> Bye,
> bearophile
Kenji also implemented functionality to allow all of the
following:
auto[] ai = new int[](3);
const* ci = new int(1);
immutable[$] = [1, 2, 3];
More information about the Digitalmars-d
mailing list