The effect is as you write, but it’s achieved using a slightly different sequence:
-
The post-increment has highest precedence, so it’s evaluated first. However, its return value (which is processed by further operators) is the value of
iter
before the increment. -
Dereference is evaluated next, returning pointer to which the non-incremented value of
iter
was “pointing.” -
delete
is evaluated last, and the pointer is deleted.
solved C++ operator precedence