#ifndef DERIVEDH #define DERIVEDH #include #include "mother.h" #include "father.h" using namespace std; class derived: public mother, public father { int k; public: derived(int initial_i, int initial_j, int initial_k) : mother(initial_i), father(initial_j), k(initial_k) {} void f() const {cout << "derived::f, this == " << this << "\n";} struct vtbl { void (*ptr_to_destructor)(derived *); void (*ptr_to_dynamic_destructor)(derived *); void (*ptr_to_f)(const derived *); }; struct layout { const vtbl *ptr_to_vtbl; //vtbl for derived & mother in derived int i; const father::vtbl *ptr_to_fvtbl; //vtbl for father in derived int j; int k; }; }; #endif