Why this can't work:
struct Base {
Base(int a, int b) {}
};
struct Derived: Base {
// using Base::Base; // unless I add this
};
int main() {
Derived d(0, 0);
}
While this can:
struct Base {
Base(int a) {}
};
struct Derived: Base {
// using Base::Base; // without this line
};
int main() {
Derived d(0);
}
Note: C++20 GCC 10.2 (second example doesn't work in C++17 either)
What's the magic behind the second example in C++20?