D
DaKoadMunky
I was recently reading an article about sequence points that used the canonical
i = i++;
as an illustration of modifying a variable multiple times between sequence
points.
Curiously the article did not indicate the type of i.
Is it fair to say that if i was an instance of a class type that overloaded
operator++(int) that we are no longer dealing with undefined behavior?
My reasoning is that in that case
i = i++;
is actually
i.operator=(i.operator++(0));
and i is not really being modified multiple times between sequence points.
Can anyone shed some light on this?
i = i++;
as an illustration of modifying a variable multiple times between sequence
points.
Curiously the article did not indicate the type of i.
Is it fair to say that if i was an instance of a class type that overloaded
operator++(int) that we are no longer dealing with undefined behavior?
My reasoning is that in that case
i = i++;
is actually
i.operator=(i.operator++(0));
and i is not really being modified multiple times between sequence points.
Can anyone shed some light on this?