the operator++() is pre-increment and should behave:
Pre-increment and pre-decrement operators increments or decrements the value of the object and returns a reference to the result.
the operator++(int) is post-increment and should behave:
Post-increment and post-decrement creates a copy of the object, increments or decrements the value of the object and returns the copy from before the increment or decrement.
As per https://en.cppreference.com/w/cpp/language/operator_incdec
the
operator++()
is pre-increment and should behave:the
operator++(int)
is post-increment and should behave:The implementations are just switched with this.