1. Since the pre-increment and post-increment operators are unary operators, the overloads are distinguished by adding an int parameter (dummy parameter) to the post-increment, and when the post-increment is called, the compiler automatically assigns a 0 value to the parameter.
2. The pre-increment operator returns a reference to the object that called it, and the increment operator returns a const temporary object
3. Since the former self-increment is a reference to the original object, it is possible to perform a formula similar to ++++a;
However, the post-increment returns a copy of the object before the increment operator after the call, and if the temporary object returned by the increment operator is not const, then the a++++ phenomenon may occur, and the second + + function is actually a temporary object, which is obviously out of the original intention. One of the principles in C + + is "Never let a user change a temporary object" (except exception handling), because the temporary object is generated by the compiler, we cannot actively use it, and its lifetime can not be mastered by us, so in addition to using temporary objects to act as a "vector" of incoming parameters or return values, Any changes to the temporary object are meaningless and are severely forbidden by the compiler.
The same goes for the inability to pass a temporary object to a function that accepts a non-const reference. That is, unless a reference is returned, the temporary object is returned, and any change to the temporary object (except exception handling) is not allowed!
4. Since the increment to create an object to save a copy of the previous object, it is lower than the previous self-increment, in the case of the same effect is recommended before the use of self-increment.
5. If both pre-and post-increment are to be defined, the definition of post-increment is best achieved by the previous self-increment as the basis for implementation, thus guaranteeing the consistency of their behaviour.
More effective C + + clause 6 distinguishes the increment/decrement operator from the front (prefix) and post (postfix) forms