[Solved] C++ operator precedence


The effect is as you write, but it’s achieved using a slightly different sequence:

  1. 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.

  2. Dereference is evaluated next, returning pointer to which the non-incremented value of iter was “pointing.”

  3. delete is evaluated last, and the pointer is deleted.

solved C++ operator precedence