Standalone AA implementation ready for review (Was: Re: Replacing AA's in druntime)

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Mar 14 21:58:01 PDT 2012


On 3/14/12 6:16 PM, H. S. Teoh wrote:
> - Declaring an AA with non-const array keys will cause reams and reams
>    of compile errors. I'm not *too* worried about this at the moment
>    since it doesn't make sense to have non-const AA keys anyway. I'm also
>    seriously considering forcing *all* AA keys to be immutable, in which
>    case this will become a non-issue.

I think the built-in associative array must allow non-constant keys. As 
long as there's no memory safety issue, the AA should work with types 
that the user doesn't change for comparison purposes but can otherwise 
modify.

A practical matter is that if we introduce this restriction we'll break 
a ton of code.


Andrei


More information about the Digitalmars-d mailing list