In C++14, I'm deriving from a struct:
struct base {
int i;
};
struct derived: base {};
I can initialize base
:
base b{10};
But I can't do the same with derived
:
derived d{10};
This is working in C++17, but with earlier compilers seems invalid. How can I initialize base fields from derived?
It seems the compiler is looking for the copy-constructor, which is obviously invalid here.