c++17 has introduced an Extension to Aggregate Initialization(P0017R1) which provides for the construction of a derived instance while still explicitly initializing the base class:
struct base { int a1, a2; };
struct derived : base { int b1; };
derived d1{{1, 2}, 3}; // full explicit initialization
derived d1{{}, 1}; // the base is value initialized
Thus using the "Extension to Aggregate Initialization" you'll want to use the code: Child c{ {}, 1 }
as mentioned in Nicol Bolas's answer again with his caveat that you'd need to use public
not private
inheritance to do aggregate initialization at all.
Unfortunately visual-studio-2017 did not support P0017R1 until version 15.7. So it may be necessary to upgrade your Visual Studio to accomplish this.
If that's not possible, and you're able to get by without polymorphisim, you can temporarily define:
struct Child {
Parent a;
int b;
};
Which would allow you to use the consistent code: Child c{ {}, 1 }
now and whenever you change back to inheritance after upgrading to 15.7.