Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
TYPE_INFO_INEQUALITY.cpp
Go to the documentation of this file.
1// checking for type_info::operator!=()
2
3
25#include "config.h"
26
27
28#ifndef _RWSTD_NO_STD_TYPE_INFO
29# define NAMESPACE(name) namespace name
30#else
31# ifndef _RWSTD_NO_GLOBAL_TYPE_INFO
32# define NAMESPACE(ignore) extern "C++"
33# define std /* empty */
34# else
35# ifndef _RWSTD_NO_RUNTIME_IN_STD
36# define NAMESPACE(name) namespace name
37# else
38# define NAMESPACE(ignore) extern "C++"
39# define std /* empty */
40# endif // _RWSTD_NO_RUNTIME_IN_STD
41# endif // _RWSTD_NO_GLOBAL_TYPE_INFO
42#endif // _RWSTD_NO_STD_TYPE_INFO
43
44
46
47
48#if defined (__EDG__) || defined (__sgi)
49 // let edg (or some of its derivatives) know about this fake type_info
50# if !defined (__GNUG__) && !defined (__INTEL_COMPILER)
51# pragma define_type_info
52# endif
53#endif // __EDG__
54
55
56class type_info
57{
58public:
59
60 bool operator!= (const type_info&) const;
61
62 virtual ~type_info ();
63};
64
65#ifdef _RWSTD_NO_TYPE_INFO_DTOR
66
67type_info::~type_info () { }
68
69#endif // _RWSTD_NO_TYPE_INFO_DTOR
70
71} // namespace std
72
73
74struct B { virtual ~B () { } };
75struct D: B { };
76struct E: B { };
77struct F: B { };
78
79
80int main (int argc, char *argv[])
81{
82 D d;
83 E e;
84 F f;
85
86 B *b1 = &d;
87 B *b2 = &d;
88
89 if (argc > 3) {
90 b1 = &d;
91 b2 = &e;
92 }
93 else if (argc > 2) {
94 b1 = &d;
95 b2 = &f;
96 }
97
98 if (argc > 1)
99 return typeid (*b1) != typeid (*b2);
100
101 // link only test
102 return 0;
103}
#define d
Definition 17.names.cpp:115
#define e
Definition 17.names.cpp:118
#define b1
Definition 17.names.cpp:226
#define f
Definition 17.names.cpp:119
#define b2
Definition 17.names.cpp:252
#define main
#define NAMESPACE(name)
bool operator!=(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
Definition json.h:14762
Definition json.h:5363
virtual ~B()