Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
GLOBAL_TYPE_INFO.cpp
Go to the documentation of this file.
1// checking for class ::type_info
2
3
25#if defined (__EDG__) || defined (__sgi) && !defined (__GNUG__)
26 // let edg (or its derivative) know about this fake type_info
27# pragma define_type_info
28#endif // __EDG__
29
30
31class type_info { };
32
33
34struct B { virtual ~B () { } };
35struct D: B { };
36struct E: B { };
37
38
39int main (int argc, char *argv[])
40{
41 const type_info* ti1 = 0;
42 const type_info* ti2 = 0;
43
44 if (argc > 3) {
45 ti1 = &typeid (D);
46 ti2 = &typeid (E);
47 }
48 else if (argc > 2) {
49 ti1 = &typeid (D);
50 ti2 = &typeid (D);
51 }
52
53 if (argc > 1)
54 return ti1 == ti2;
55
56 // link only test
57 return 0;
58}
#define E
Definition 17.names.cpp:148
#define D
Definition 17.names.cpp:147
#define main
virtual ~B()