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