[over.inc] (original) (raw)
An increment operator functionis a function named operator++.
If this function is a non-static member function with no non-object parameters, or a non-member function with one parameter, it defines the prefix increment operator++for objects of that type.
If the function is a non-static member function with one non-object parameter (which shall be of typeint) or a non-member function with two parameters (the second of which shall be of typeint), it defines the postfix increment operator++for objects of that type.
When the postfix increment is called as a result of using the++operator, theintargument will have value zero.107
[Example 1: struct X { X& operator++(); X operator++(int); };struct Y { }; Y& operator++(Y&); Y operator++(Y&, int); void f(X a, Y b) { ++a; a++; ++b; b++; a.operator++(); a.operator++(0); operator++(b); operator++(b, 0); } — _end example_]