And the containing object does not have special access to the class that contains it, and does not know at all that it is contained. You need to pass a link or pointer to the containing class somehow - for example:
class Child{
public:
void doOtherThing( Parent & p );
};
void Child::doOtherThing( Parent & p ){
p.doSomething();
}
anon
source
share