Explain the difference between pre- and post increment/decrement operators
Show answer and explanation
Prefix increment modifies the operand and yields the incremented object, normally as an lvalue reference. Postfix increment also modifies the operand but returns the old value as a separate result, which can require extra work for user-defined types.
Prefix increment modifies the operand and yields the incremented object, normally as an lvalue reference. Postfix increment also modifies the operand but returns the old value as a separate result, which can require extra work for user-defined types.
Connect the conclusion directly to the type, lifetime, ownership, overload-resolution rule, or library contract present in the question. State implementation dependence or a violated precondition explicitly instead of merely guessing output.