R
Ruby Stevenson
All -
I am reading Effective C++, item 24 on implicit type conversion. The
example given is that:
class Rational {
public:
Rational (int numerator=0, int denominator=1);
const Rational operator*(const Rational &rhs) const;
}
Rational oneHalf(1,2);
result = oneHalf * 2; // fine
result = 2 * oneHalf; //error
The book then says "It turns out that parameters are eligible for
implicit type conversion only if they are listed in the parameter
list" ...
I am confused as to what parameter list it is talking about??
thanks
Ruby
I am reading Effective C++, item 24 on implicit type conversion. The
example given is that:
class Rational {
public:
Rational (int numerator=0, int denominator=1);
const Rational operator*(const Rational &rhs) const;
}
Rational oneHalf(1,2);
result = oneHalf * 2; // fine
result = 2 * oneHalf; //error
The book then says "It turns out that parameters are eligible for
implicit type conversion only if they are listed in the parameter
list" ...
I am confused as to what parameter list it is talking about??
thanks
Ruby