Rang violation using AA's

Nrgyzer nrgyzer at unknownMailAddress.com
Fri Feb 8 14:00:42 PST 2013


On Friday, 8 February 2013 at 20:30:00 UTC, Maxim Fomin wrote:
> On Friday, 8 February 2013 at 20:10:32 UTC, Nrgyzer wrote:
>> void main() {
>>   int[string] b;
>>   b["hello"] = 3;
>> }
>>
>> This works for both versions... but I don't know why using a 
>> method with ref-return value doesn't work anymore.
>>
>> Thanks for your suggestion.
>
> This works because an element is assigned if absent (expression 
> is treated as lvalue). In case of return an element is not 
> assigned (rvalue), so exception is thrown. I do not now why it 
> worked in 2.060.

It worked in version 2.060 and lower... but as already mentioned 
not in 2.061. I don't know if it's intended or not.


More information about the Digitalmars-d-learn mailing list