These are functions and Struct declarations I have, and I'm not allowed to change them.
DerivedA giveDerivedA ();
DerivedB giveDerivedB ();
struct Base{
QString elementId;
QString elementType;
};
struct DerivedA : Base {
int a;
int b;
};
struct DerivedB : Base {
int c;
int d;
};
But what I need is something like this:
struct DerivedA : Base {
int a;
int b;
void create();
QString doc;
};
How can I add these method and member to structs I got?
My first idea is:
struct myA: DerivedA {
void create();
QString doc;
};
Do you have any suggestion?
Edit: 2nd Alternative(Choosed)
struct myA{
void create();
QString doc;
private:
DerivedA derivedA;
};