Hey there,
I have a custom struct hierarchy that goes vaguely like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
struct Base
{};
struct Derived1 : public Base
{
int num;
};
struct Derived2 : public Base
{
char c;
};
// etc.
I'm using "Base" simply as an umbrella struct, so I can access any of the derived structs with a "base" reference(&).
The issue I'm having is, I have a class that has a data member that is a reference to the struct "Base" but, I'm getting an error that says my constructor for this class doesn't provide an initialiser for that data member.
I've tried intialising a derived object for the reference, like so: