Order of evaluation of post-increment operator

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Dec 28 12:25:58 PST 2014


John Colvin:

> I guess there are cases where it's not easily catchable:
>
> void foo(int* p0, int* p1)
> {
>     (*p0)++ = (*p1)++;
> }
>
> what happens when p0 == p1?

The undefined code can be found statically, the run-time values 
are irrelevant.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list