Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
EXTERNAL_HEADERS
RSL
etc
config
src
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
45
NAMESPACE
(
std
) {
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
56
class
type_info
57
{
58
public
:
59
60
bool
operator!=
(
const
type_info
&)
const
;
61
62
virtual
~type_info
();
63
};
64
65
#ifdef _RWSTD_NO_TYPE_INFO_DTOR
66
67
type_info::~type_info () { }
68
69
#endif
// _RWSTD_NO_TYPE_INFO_DTOR
70
71
}
// namespace std
72
73
74
struct
B
{
virtual
~B
() { } };
75
struct
D
:
B
{ };
76
struct
E
:
B
{ };
77
struct
F
:
B
{ };
78
79
80
int
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
}
d
#define d
Definition
17.names.cpp:115
e
#define e
Definition
17.names.cpp:118
b1
#define b1
Definition
17.names.cpp:226
f
#define f
Definition
17.names.cpp:119
b2
#define b2
Definition
17.names.cpp:252
main
#define main
Definition
BAD_ALLOC_COPY_CTOR.cpp:32
NAMESPACE
#define NAMESPACE(name)
Definition
TYPE_INFO_INEQUALITY.cpp:29
type_info
Definition
GLOBAL_TYPE_INFO.cpp:31
operator!=
bool operator!=(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
Definition
json.h:14762
B
Definition
NAMESPACE.cpp:31
std
Definition
json.h:5363
B::~B
virtual ~B()
Definition
TYPE_INFO_INEQUALITY.cpp:74
D
Definition
DEFAULT_TEMPLATE_ARGS.cpp:35
E
Definition
GLOBAL_TYPE_INFO.cpp:36
F
Definition
TYPE_INFO_BEFORE.cpp:77
Generated by
1.9.8