More magical AA semantics

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Jan 12 19:06:39 PST 2013


On 1/12/13 8:26 PM, deadalnix wrote:
> On Saturday, 12 January 2013 at 21:56:13 UTC, Andrei Alexandrescu wrote:
>> On 1/12/13 7:40 AM, Jonathan M Davis wrote:
>>> On Saturday, January 12, 2013 13:30:47 monarch_dodra wrote:
>>>> What about "++a[0]" when there is no a[0]? Is this something that
>>>> will throw or not?
>>>
>>> Personally, I think that it should, but there's probably a good
>>> chance that it
>>> won't, because it's an lvalue. I don't know what will happen with
>>> that though.
>>> There are a lot of bugs right now related elements being inserted
>>> into AAs
>>> when they shouldn't be, so I really don't know how much relation the
>>> current
>>> behavior will have with the behavior that AAs will ultimately have.
>>
>> ++a[0] should work.
>>
>
> Can you explain why ?

Did so in https://github.com/D-Programming-Language/dmd/pull/1465

Andrei


More information about the Digitalmars-d mailing list