Proof of concept - library AA

Martin Nowak via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 8 14:39:04 PDT 2015


On 07/08/2015 02:20 PM, Uranuz wrote:
> As far as I understand from that discussion it this feature was not
> accepted because of template bloat. Am I wrong?

The main reason is that AA literals already have an incompatible semantic.

pragma(msg, typeof(["0": ubyte(0), "1": ushort(1)]));

prints int[string]

Heterogeneous AA literals would require to move that type coercion from
the compiler into the AA constructor.
That's bad b/c the behavior of the literal would depend on the callee.
And it would be difficult to avoid type conversion at runtime and
template bloat for each different literal.


More information about the Digitalmars-d mailing list