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
tests
regress
26.valarray.cshift.stdcxx-316.cpp
Go to the documentation of this file.
1
29
// Test to detect memory corruption (such as the use of uninitialized
30
// storage) in valarray.
31
32
#include <cassert>
33
#include <valarray>
34
35
struct
S
{
36
const
S
*
const
self
;
37
S
(): self (this) { }
38
S
(
const
S
&
s
): self (this) {
assert
(&
s
==
s
.self); }
39
~S
() {
assert
(
this
== self); }
40
41
void
operator= (
const
S
&
s
) {
assert
(
this
== self && &
s
==
s
.
self
); }
42
};
43
44
45
int
main
()
46
{
47
const
std::valarray<S>
a
(2);
48
49
a
.cshift (1);
50
51
return
0;
52
}
a
#define a
Definition
17.names.cpp:109
s
#define s
Definition
rw_alg_test.h:221
main
int main()
Definition
26.valarray.cshift.stdcxx-316.cpp:45
assert
#define assert(expr)
Definition
_cassert.h:40
S
Definition
COLLAPSE_TEMPLATE_STATICS.cpp:40
S::~S
~S()
Definition
26.valarray.cshift.stdcxx-316.cpp:39
S::S
S(const S &s)
Definition
26.valarray.cshift.stdcxx-316.cpp:38
S::self
const S *const self
Definition
26.valarray.cshift.stdcxx-316.cpp:36
S::S
S()
Definition
26.valarray.cshift.stdcxx-316.cpp:37
Generated by
1.9.8