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
GLOBAL_EXCEPTION.cpp
Go to the documentation of this file.
1
// checking for class ::exception
2
3
25
#include "config.h"
26
27
28
#ifndef _RWSTD_NO_HONOR_STD
29
# ifdef _RWSTD_NO_STD_TERMINATE
30
# include "
terminate.h
"
31
# endif
// _RWSTD_NO_STD_TERMINATE
32
#endif
// _RWSTD_NO_HONOR_STD
33
34
class
exception
{ };
35
36
struct
B
{
virtual
~B
() { } };
37
struct
D1
:
B
{ };
38
struct
D2
:
B
{ };
39
40
int
main
()
41
{
42
D1
d1
;
43
B
&
b
=
d1
;
44
45
try
{
46
// throws [std::] bad_cast
47
D2
&
d2
=
dynamic_cast<
D2
&
>
(
b
);
48
}
49
catch
(
exception
&) {
50
return
0;
51
}
52
catch
(...) {
53
// fail if cast throws anything other than an ::exception-derivative
54
return
1;
55
}
56
57
// fail if cast doesn't throw
58
return
2;
59
}
d1
#define d1
Definition
17.names.cpp:228
b
#define b
Definition
17.names.cpp:110
d2
#define d2
Definition
17.names.cpp:254
main
int main()
Definition
GLOBAL_EXCEPTION.cpp:40
exception
Definition
GLOBAL_EXCEPTION.cpp:34
B
Definition
NAMESPACE.cpp:31
B::~B
virtual ~B()
Definition
GLOBAL_EXCEPTION.cpp:36
D1
Definition
GLOBAL_BAD_CAST.cpp:39
D2
Definition
GLOBAL_BAD_CAST.cpp:40
terminate.h
Generated by
1.9.8