#include using namespace std; class Base1 { public: Base1 (const char *m):msg (m) { std::cout << "Base1::Base1(" << msg << ")" << std::endl; } ~Base1 () { std::cout << "Base1::~Base1(" << msg << ")" << std::endl; } const char *msg; }; class Base2 { public: Base2 (const char *m):msg (m) { std::cout << "Base2::Base2(" << msg << ")" << std::endl; } ~Base2 () { std::cout << "Base2::~Base2(" << msg << ")" << std::endl; } const char *msg; }; class Type : public Base1, public Base2 { public: Type(const char *m, const char *n, const char *o) : Base1(m), Base2(n), note(o) { std::cout << "Type::Type(" << note << ")" << std::endl; } ~Type() { std::cout << "Type::~Type(" << note << ")" << std::endl; } private: const char *note; }; class Base3 { public: virtual char do_this (char) =0; virtual short do_this (short) =0; virtual int do_this (int) =0; virtual float do_this (float) =0; }; class Derived : public Base3 { public: virtual char do_this(char x) { return do_this_impl(x); } virtual short do_this(short x) { return do_this_impl(x); } virtual int do_this(int x) { return do_this_impl(x); } virtual float do_this(float x) { return do_this_impl(x); } private: template TYPE do_this_impl(TYPE t) { std::cout << t << std::endl; return t; } }; Type mb("static", "main", "mb"); void func () { std::cout << "main" << std::endl; Type new_base = Type ("new base", "main", "new_base"); Derived xyz; xyz.do_this ((char)'1'); xyz.do_this ((short)2); xyz.do_this ((int)3); xyz.do_this ((float) 4.1); while(1); } int main (int argc, char **argv) { func(); } (fhpd) list 74* void 75 func () 76 { 77 std::cout << "main" << std::endl; 78 Type new_base = Type ("new base", "main", "new_base"); 79 Derived xyz; 80 xyz.do_this ((char)'1'); 81 xyz.do_this ((short)2); 82 xyz.do_this ((int)3); 83 xyz.do_this ((float) 4.1); 84 while(1); 85 } 86 87 88 int 89 main (int argc, char **argv) 90 { 91 func(); 92 } (fhpd) what xyz Derived at /home/scox/accu/src/tstctors0.cc#79 (fhpd) what Derived public Base3 { void Derived (); void Derived (); char do_this (char ); short int do_this (short int ); int do_this (int ); float do_this (float ); private: char do_this_impl (char ); short int do_this_impl (short int ); int do_this_impl (int ); float do_this_impl (float ); } at /home/scox/accu/src/tstctors0.cc#57 (fhpd) print Derived Error: Symbol "Derived" is not found in the current context. (fhpd) print xyz {Base3={_vptr.Base3=0x401290, }, } (fhpd) what mb extern Type at (fhpd) what Type public Base1, public Base2 { private: byte * note; void Type (byte * ,byte * ,byte * ); void ~Type (); } at /home/scox/accu/src/tstctors0.cc#33 (fhpd) print mb {Base1={msg=0x401240 "static", }, Base2={msg=0x40123b "main", }, note=0x401238 "mb", } (fhpd) quit Quitting...