Warning! 18++ content!

Not really. In C/C++ and js, it returns the original value before incrementing, and then performs the increment operation. In C/C++, if x is a pointer, it increments the value by the size of the pointer type (eg, for uint32_t*, it increments by 4).

coliru example for the easy parts.

What really bites is in c++, an object can implement postincrement and postdecrement operations, and because of the "return original before increment" semantics, that often means creating a temporary copy of the object (which may be expensive), incrementing the original, and returning the copy... then almost immediately destroying the copy as it falls out of scope.

/r/ProgrammerHumor Thread Parent