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
STATIC_CONST_MEMBER_INIT.cpp
Go to the documentation of this file.
1
// checking for const member initializer
2
3
25
struct
A
26
{
27
static
const
int
i
= 1;
28
29
enum
E
{
e0
,
e1
};
30
31
static
const
E
e
=
e0
;
32
static
const
E
f
=
e1
;
33
};
34
35
const
int
A::i;
36
37
const
A::E A::e;
38
const
A::E A::f;
39
40
41
enum
F
{
f2
= 2,
f3
= 3 };
42
43
template
<
class
T>
44
struct
B
45
{
46
static
const
int
i
= 2;
47
48
static
const
F
e
=
f2
;
49
static
const
F
f
=
f3
;
50
};
51
52
template
<
class
T>
53
const
int
B<T>::i
;
54
55
template
<
class
T>
56
const
F
B<T>::e
;
57
58
template
<
class
T>
59
const
F
B<T>::f
;
60
61
62
int
main
()
63
{
64
int
result
= 0;
65
66
if
(1 != A::i)
67
result
=
result
<< 1 + 1;
68
69
if
(A::e0 != A::e)
70
result
=
result
<< 1 + 1;
71
72
if
(A::e1 != A::f)
73
result
=
result
<< 1 + 1;
74
75
if
(2 !=
B<int>::i
)
76
result
=
result
<< 1 + 1;
77
78
if
(
f2
!=
B<char>::e
)
79
result
=
result
<< 1 + 1;
80
81
if
(
f3
!=
B<void>::f
)
82
result
=
result
<< 1 + 1;
83
84
return
result
;
85
}
i
#define i
Definition
17.names.cpp:126
e
#define e
Definition
17.names.cpp:118
e1
#define e1
Definition
17.names.cpp:229
f
#define f
Definition
17.names.cpp:119
f2
#define f2
Definition
17.names.cpp:256
result
volatile int result
Definition
18.limits.traps.stdcxx-624.cpp:35
f2
@ f2
Definition
STATIC_CONST_MEMBER_INIT.cpp:41
f3
@ f3
Definition
STATIC_CONST_MEMBER_INIT.cpp:41
main
int main()
Definition
STATIC_CONST_MEMBER_INIT.cpp:62
A
Definition
NAMESPACE.cpp:25
B
Definition
NAMESPACE.cpp:31
A::e0
@ e0
Definition
STATIC_CONST_MEMBER_INIT.cpp:29
B
Definition
DEFAULT_TEMPLATE_ARGS.cpp:29
E
Definition
GLOBAL_TYPE_INFO.cpp:36
F
Definition
TYPE_INFO_BEFORE.cpp:77
Generated by
1.9.8