Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
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
35struct 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
45int main ()
46{
47 const std::valarray<S> a (2);
48
49 a.cshift (1);
50
51 return 0;
52}
#define a
Definition 17.names.cpp:109
#define s
#define assert(expr)
Definition _cassert.h:40
const S *const self