#include<iostream> using namespace std; class A { public: A(int x){rx = x;} friend ostream&operator<<(ostream&s,A&a) { s<<a.rx; return s; } int operator++(){cout<<"++i\n";rx++;return rx;} int operator++(int){cout<<"i++\n";int i=rx;rx++;return i;} private: int rx; };
int main() { A a(3); cout<<++a<<a++<<endl; //cout<<++a<<endl; //cout<<a++<<endl; return 0; }