Hi All,
I want to know if the following is possible.
As you can see from this simple code the Advanced Base Class expects a MyStruct as a constructor parameter. The derived Basic class doesnt have any constructor paramets and tries to constuct an AdvancedClass with a MyStruct object that has an x value of 0.Code:struct MyStruct { int x; } ; class AdvancedClass { AdvancedClass( MyStruct myStruct ) ; }; class BasicClass : public AdvancedClass { BasicClass(void) ; }; BasicClass::BasicClass(void) : AdvancedClass( {0} ) // doesnt compile { }
The problem is that I dont know how to initialize a new MyStruct object inside the creation of the AdvancedClass object from the initialization list of the BasicClass object.
Any ideas?
Thanks