Thinking as a C++ programmer:
If i had a class Integer and the post-increment operator implemented, it would save the previous value of my Integer, increment its real value and then return the saved value. Therefore, for "i = 0", after "i = i++" "i" would be 0.

Thinking as a C++ programmer:
If i had a class Integer and the post-increment operator implemented, it would save the previous value of my Integer, increment its real value and then return the saved value. Therefore, for "i = 0", after "i = i++" "i" would be 0.

Integer classes are slightly different, because then i++ would be a function call, and which forces i to be changed before the function returns. The likely result is equivalent to i=i, as you point out, though a hypothetical compiler could end up doing i=i+1 after in-lining and optimization, as if it were just a regular integer.