1 class myInt { 2 private: int theValue; myInt()3 public: myInt() : theValue(0) {} myInt(int _x)4 public: myInt(int _x) : theValue(_x) {} val()5 int val() { return theValue; } 6 }; 7 8 class myIntAndStuff { 9 private: 10 int theValue; 11 double theExtraFluff; 12 public: myIntAndStuff()13 myIntAndStuff() : theValue(0), theExtraFluff(1.25) {} myIntAndStuff(int _x)14 myIntAndStuff(int _x) : theValue(_x), theExtraFluff(1.25) {} val()15 int val() { return theValue; } 16 }; 17 18 class myArray { 19 public: 20 int array[16]; 21 }; 22 23 class hasAnInt { 24 public: 25 myInt theInt; hasAnInt()26 hasAnInt() : theInt(42) {} 27 }; 28 operator +(myInt x,myInt y)29myInt operator + (myInt x, myInt y) { return myInt(x.val() + y.val()); } operator +(myInt x,myIntAndStuff y)30myInt operator + (myInt x, myIntAndStuff y) { return myInt(x.val() + y.val()); } 31 main()32int main() { 33 myInt x{3}; 34 myInt y{4}; 35 myInt z {x+y}; 36 myIntAndStuff q {z.val()+1}; 37 hasAnInt hi; 38 myArray ma; 39 40 return z.val(); // break here 41 } 42