这样的继承树是否存在问题:
Parent ---- Subject
| /
| /
Child --/
或在代码中:
class Subject
{
public:
void AddObserver( Observer *aObserver );
protected:
ObserversList mObserversList;
};
class Parent: public Object,
public virtual Subject
{
};
class Child: public Parent,
public virtual Subject
{
};