Evaluation order of index expressions

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Wed May 27 00:30:16 PDT 2015


On Tuesday, 26 May 2015 at 22:54:55 UTC, Timon Gehr wrote:
> On 05/26/2015 07:48 PM, deadalnix wrote:
>> On Tuesday, 26 May 2015 at 12:51:20 UTC, Timon Gehr wrote:
>>> I guess overloaded operators could be made to cache the old 
>>> value. (As
>>> they do in CTFE, apparently. :o))
>>>
>>> However, this seems like overkill. Any other ideas?
>>
>> They can but it wouldn't fix anything. The rvalue is already 
>> evaluated
>> by then.
>
> I.e. they can't.

You could make the right hand side lazy or something, but yeah, 
overkill.


More information about the Digitalmars-d mailing list