I have a function (and constructor) that should be able to accept integer and floating point values. Actually, I want him to accept int64_tor long double, therefore, I want
class Foo {
public:
Foo(int64_t value=0);
Foo(long double value);
};
However, if I do this and try Foo f = 1;, the compiler complains that the conversion from intto is Fooambiguous. Well, but if I changed the first constructor to, then there is no such ambiguity. Can someone explain to me why this is so.
source
share