class X {
public:
X() = delete;
X(int x = 1) : _x(x) {}
private:
int _x;
};
int main() {
X x; // why is this call ambigious?
}
In the code above why is the construction in the main ambigious when the default constructor is deleted and when not the code compiles?! It makes sense that when deleted the construction has only one constructor to call (that is the one with the default argument)