// ++i first +1,then return new value Integer &operator++() { cout << "Integer::operator++()" << endl; v++; return *this; }
// i++ first save old value,then +1,last return old value Integer operator++(int) { cout << "Integer::operator++(int)" << endl; Integer old = *this; v++; return old; }
voidoutput() { cout << "value " << v << endl; } private: int v; };