T
TheFlyingDutchman
given ClassA methods:
ClassA operator+(const long& ) const;
ClassA operator+(const int& ) const;
ClassA operator+(const double& ) const;
ClassA operator+(const ClassB&) const;
I get a warning:
warning: ISO C++ says that these are ambiguous even though the worst
conversion for the first is better than the worst conversion for the
second
I can get rid of the warning if I remove the ClassB constructor that
takes a double:
ClassB(double &);
But I would prefer to leave it in if there was some other way to clear
up the ambiguity.
ClassA operator+(const long& ) const;
ClassA operator+(const int& ) const;
ClassA operator+(const double& ) const;
ClassA operator+(const ClassB&) const;
I get a warning:
warning: ISO C++ says that these are ambiguous even though the worst
conversion for the first is better than the worst conversion for the
second
I can get rid of the warning if I remove the ClassB constructor that
takes a double:
ClassB(double &);
But I would prefer to leave it in if there was some other way to clear
up the ambiguity.