Non-member overloads also use the dummy int parameter to distinguish them:
friend void operator++(Number&);
Please note that some people may expect that they emulate the behavior of an inline operator, returning new and old values ββrespectively:
Number& operator++(Number& fst) { fst.number=fst.number+1; return fst; // reference to new value } Number operator++(Number& fst, int) { Number old = fst; ++fst; return old; // copy of old value }
source share