Order of evaluation of post-increment operator

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Dec 28 11:49:24 PST 2014


On Sunday, 28 December 2014 at 17:34:52 UTC, Marc Schütz wrote:
> On Sunday, 28 December 2014 at 16:05:32 UTC, bearophile wrote:
>> (IMHO it must be).
>
> Disallowing is an alternative to consider. Even defined 
> behaviour can be unintuitive and error prone.

I guess there are cases where it's not easily catchable:

void foo(int* p0, int* p1)
{
     (*p0)++ = (*p1)++;
}

what happens when p0 == p1?


More information about the Digitalmars-d-learn mailing list