## 21.7.2 Replicated Base Classes (cont.)

- `TeachingAssistant*` can always be converted to an `Employee*`, then to a `Person*`
- Without virtual inheritance, a `TeachingAssistant*` can not be converted directly to a `Person*`:

  > `TeachingAssistant* fred = new TeachingAssistant();
  > Student* s = fred; // Legal, because TeachingAssistant is-a Student
  > Person* p1 = s;
  > Employee* e = fred;
  > Person* p2 = e;
  > Person* p3 = fred; // Legal if virtual inheritance used, otherwise error`

prev |top |next