Please, look at this code:
#include <iostream>
class A {
public:
int my;
A(int a=0) : my(a) { }
};
int main() {
A x = 7; // 1
A y = 6.7; // 2
std::cout << x.my << " " << y.my << "\n";
}
It actually compiles although there is no A(double a);
constructor.
When exactly compiler is allowed to convert one argument type to another to call corresponding constructor?