User-defined conversions are used implicitly only if they are unambiguous
. A conversion function in a derived class does not hide a conversion function
in a base class unless the two functions convert to the same type
. Function overload resolution (
[over.match.best]) selects the best
conversion function to perform the conversion
. [
Example 2:
struct X {
operator int();
};
struct Y : X {
operator char();
};
void f(Y& a) {
if (a) {
}
}
—
end example]