#include #include "00-conversionClass.h" int main() { cout << "----- 1 ------------------------------------" << endl; MyClass a(0); cout << "----- 2 ------------------------------------" << endl; MyClass b(1); cout << "----- 3 ------------------------------------" << endl; a = a + 1; cout << "----- 4 ------------------------------------" << endl; b = b + "one"; cout << "----- 5 ------------------------------------" << endl; // This version will invoke our << operator cout << "1 + a + b + 4 = " << (1 + a + b + 4) << endl; cout << "----- 6 ------------------------------------" << endl; // This version explicitly converts the result to an int, which is then output cout << "1 + a + b + 4 = " << (int)(1 + a + b + 4) << endl; cout << "----- 7 ------------------------------------" << endl; // Here we do integer addition, then construct a MyClass object, // then move assign it to b. b = 20 + int(a); cout << "b = 20 + int(a) ==> b = " << int(b) << endl; // Will this compile? run? // cout << "----- 8 ------------------------------------" << endl; // a = 2 * (a + b); // cout << "a = 2 * (a + b) ==> a = " << int(a) << endl; }