Let's conside the following member function:
Rational operator + ( const Rational & ) const; //Rational is the class name
Complier translates a + b
to a.operator+(b)
case 1: a + 14 //a is Rational
class object.
This works fine, because 14 is implicitly converted to class type Rational
(Am I correct ?)
case 2: 14 + a // a is a Rational
class object.
This does not work because 14 is not a Rational
class object.
My question : Why does the compiler not perform impicit conversion in case 2?