12.2几个特殊运算符的重载 12.2.1增量减量运算符 type class_name: operator++0;∥前置增量 type class_name: operator++(nt);∥后置增量 例 class X t public (inta=0):X(a)旮} int Geto return X int operator ++ o return ++X: 1 int operator ++(int)( return x++;312.2 几个特殊运算符的重载 12.2.1 增量减量运算符 type class_name :: operator ++ (); // 前置增量 type class_name :: operator ++ (int); // 后置增量 例: class X { int x; public: X(int a = 0) : x(a) {} int Get() { return x; } int operator ++ () { return ++ x; } int operator ++ (int) { return x ++; } }