ReactOS
0.4.16-dev-401-g45b008d
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
stterm-test.cc
Go to the documentation of this file.
1
/*
2
* The conversation with Matti Rintala on STLport forum 2005-08-24:
3
*
4
* Do you mean ISO/IEC 14882 3.6.3 [basic.start.term]?
5
*
6
* Yes. "Destructors (12.4) for initialized objects of static storage duration
7
* (declared at block scope or at namespace scope) are called as a result
8
* of returning from main and as a result of calling exit (18.3). These objects
9
* are destroyed in the reverse order of the completion of their constructor
10
* or of the completion of their dynamic initialization."
11
*
12
* I found a confirmation on the web that gcc may not strictly conform
13
* to this behaviour in certains cases unless -fuse-cxa-atexit is used.
14
*
15
* Test below give (without -fuse-cxa-atexit)
16
17
Init::Init()
18
Init::use_it
19
It ctor done <-- 0
20
Init::use_it done
21
Init ctor done <-- 1
22
Init2 ctor done <-- 2
23
It dtor done <-- 0
24
Init2 dtor done <-- 2
25
Init dtor done <-- 1
26
27
28
* but should:
29
30
Init::Init()
31
Init::use_it
32
It ctor done <-- 0
33
Init::use_it done
34
Init ctor done <-- 1
35
Init2 ctor done <-- 2
36
Init2 dtor done <-- 2
37
Init dtor done <-- 1
38
It dtor done <-- 0
39
40
41
*/
42
#include <stdio.h>
43
44
using namespace
std
;
45
46
class
Init
47
{
48
public
:
49
Init
();
50
~Init
();
51
52
static
void
use_it
();
53
};
54
55
class
Init2
56
{
57
public
:
58
Init2
();
59
~Init2
();
60
61
};
62
63
static
Init
init
;
64
static
Init2
init2
;
65
66
class
It
67
{
68
public
:
69
It
();
70
~It
();
71
};
72
73
Init::Init
()
74
{
75
printf
(
"Init::Init()\n"
);
76
use_it
();
77
printf
(
"Init ctor done\n"
);
78
}
79
80
Init::~Init
()
81
{
82
printf
(
"Init dtor done\n"
);
83
}
84
85
void
Init::use_it
()
86
{
87
printf
(
"Init::use_it\n"
);
88
89
static
It
it;
90
91
printf
(
"Init::use_it done\n"
);
92
}
93
94
Init2::Init2
()
95
{
96
printf
(
"Init2 ctor done\n"
);
97
}
98
99
Init2::~Init2
()
100
{
101
printf
(
"Init2 dtor done\n"
);
102
}
103
104
It::It
()
105
{
106
printf
(
"It ctor done\n"
);
107
}
108
109
It::~It
()
110
{
111
printf
(
"It dtor done\n"
);
112
}
113
114
int
main
()
115
{
116
return
0;
117
}
Init2
Definition:
stterm-test.cc:56
Init2::Init2
Init2()
Definition:
stterm-test.cc:94
Init2::~Init2
~Init2()
Definition:
stterm-test.cc:99
Init
Definition:
stterm-test.cc:47
Init::Init
Init()
Definition:
stterm-test.cc:73
Init::use_it
static void use_it()
Definition:
stterm-test.cc:85
Init::~Init
~Init()
Definition:
stterm-test.cc:80
It
Definition:
stterm-test.cc:67
It::It
It()
Definition:
stterm-test.cc:104
It::~It
~It()
Definition:
stterm-test.cc:109
printf
#define printf
Definition:
freeldr.h:97
std
Definition:
features.h:417
init
static Init init
Definition:
stterm-test.cc:63
init2
static Init2 init2
Definition:
stterm-test.cc:64
main
int main()
Definition:
stterm-test.cc:114
sdk
lib
3rdparty
stlport
test
compiler
StTerm-order
stterm-test.cc
Generated on Sun Dec 29 2024 06:13:11 for ReactOS by
1.9.6