F
foggy
Derived1 and Derived2 are derived from BaseClass:
list<BaseClass&> lst;
Derived1 d1;
Derived2 d2;
lst.push_back(d1);
lst.push_back(d2);
Can a list be created like above so that d1, d2... objects can be navigated
to?
I read somewhere "A list container should not contain a list of references
since they are not assignable." What does this mean? Thanks!
list<BaseClass&> lst;
Derived1 d1;
Derived2 d2;
lst.push_back(d1);
lst.push_back(d2);
Can a list be created like above so that d1, d2... objects can be navigated
to?
I read somewhere "A list container should not contain a list of references
since they are not assignable." What does this mean? Thanks!