KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
When I run this code: struct X { int a; }; struct Y : public X {}; X x = {0}; Y Y = {0}; I get: error: could not convert ‘{0}’ from ‘<brace-enclosed initializer list>’ to ‘Y’ Why does brace initialization work for the base class but not the derived class?
Tags (comma-separated)
Save Edits
Cancel