Assume I've made a class, say Parent
, that has a composition relation with Child
. The parent class holds a list of children.
I want all children to hold a reference to the parent, so every child holds a Parent
pointer.
This will cause circular inclusion. I refer to Child
in parent.h and I refer to Parent
in child.h. Therefore Parent
will need to include Child
, which needs to include Parent
.
What's the best way to work around this?