class D2 : public C { public:

D2() {}; };

class E: public D1, public D2 { public:

E() {}; };

int main() {

Ee; try { throw e;

}

catch(C) {

printf(“caught a C object\n”);

}

catch(D1) {

printf(“caught a D1 object\n”);

}

catch(D2) {

printf(“caught a D2 object\n”);

}

catch(E) {

printf(“caught an E object\n”);

}

try { throw & e;

}

catch(C*) {

printf(“caught ptr to C object\n”);

}

catch(D1*) {

printf(“caught ptr to D1 object\n”);

}

catch(D2*) {

printf(“caught ptr to D2 object\n”);

}

catch(E*) {

printf(“caught ptr to E object\n”);

}

return 0;

}

Migration Considerations when Using Libraries

The following sections contain information about library migration from HP C++ (cfront) to HP aC++.

Standards Based Libraries

HP aC++ provides the following libraries that are not part of the HP C++ (cfront) compiler:

Standard C++ Library

Tools.h++ Library

HP aC++ Runtime Support Library

HP recommends that you use these standards based libraries whenever possible, instead of the cfront compatibility libraries. See Chapter 9: “Tools and Libraries” (page 175) for more information.

206 Migrating from HP C++ (cfront) to HP aC++