#include "00-conversionClass.h" //------------------------------------------------ // definition / initialization of class static variable //------------------------------------------------ const map MyClass::_string_map = {{"one", 1}, {"two", 2}, {"three", 3}}; //------------------------------------------------ // Here's the regular old method defining the operation // with signature int + myClassObj. //------------------------------------------------ MyClass operator+(int lhs, const MyClass& rhs) { cout << "int(" << lhs << ") + MyClass(" << rhs._val << ")" << endl; return MyClass(lhs + rhs._val); } //------------------------------------------------ // The regular old method for ostream output //------------------------------------------------ ostream& operator<<(ostream& os, const MyClass& t) { os << "(operator <<) " << t._val; return os; }