assignment: left-to-right or right-to-left evaluation?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon May 11 06:31:59 PDT 2009


Steven Schveighoffer wrote:
> On Mon, 11 May 2009 08:20:07 -0400, Manfred Nowak <svv1999 at hotmail.com> 
> wrote:
> 
>> Michel Fortin wrote:
>>
>>>           arra[i++] = arrb[j]; // how can the compiler issue an
>>>           error for this?
>>
>>
>> assert( &i != &j);
>>
>> -manfred
> 
> That is not a compiler error, it is an inserted runtime error.

Besides, it's just a particular case. Generally you can't tell modularly 
whether two expressions change the same variable.

Andrei



More information about the Digitalmars-d mailing list