#include using namespace std; class FooT { public: int Data()const{ return data; } void Data(int newValue) { data = newValue; } FooT & operator ++(){ ++data; return *this; } FooT operator ++(int) { FooT originalValue{*this}; ++data; return originalValue; } private: int data {0}; }; ostream & operator << (ostream & s, const FooT & other) { s << other.Data(); return s; } FooT & GoodFunction(FooT & other){ return other; } FooT & BadFunction(FooT other){ return other; } int main() { //int i{10}; FooT i; cout << "j = i" << endl; //int j{i}; FooT j{i}; cout << " i = " << i << " j = " << j << endl << endl; cout << "j = ++i" << endl; j = ++i; cout << " i = " << i << " j = " << j << endl << endl; cout << "j = i++" << endl; j = i++; cout << " i = " << i << " j = " << j << endl << endl; return 0; }