/* ================================================================ Define a user-defined type "my_int" This time, we cluse additional rule to allow my_int to be added to a float: ================================================================ */ class my_int { public: int operator+(float x) { return(x + value); } int value; }; my_int A; float B, C; int main(int argc, char **argv) { C = A + B; // <---- Now C++ does not complain... }