Can you tell me what is wrong in the following example? I am using C++17, where I thought the following should be supported.
class Base {
public:
virtual ~Base() = default;
};
struct Derived : public Base {
int m1;
};
int main() {
/* Results in a compilation error
* error C2440: 'initializing': cannot convert from 'initializer list' to 'Derived'
* message : No constructor could take the source type, or constructor overload resolution was ambiguous */
Derived d{ {},1 };
return 0;
}