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.transcend.stdcxx-315.cpp
Go to the documentation of this file.
1
29
#include <cassert>
30
#include <cstdio>
31
#include <cstdlib>
32
#include <cstring>
33
#include <new>
34
#include <valarray>
35
36
void
*
operator
new
(std::size_t
s
)
throw
(
std::bad_alloc
)
37
{
38
return
std::memset (std::malloc (
s
), 0x55,
s
);
39
}
40
41
bool
pass
=
true
;
42
43
struct
S
{
44
const
S
*
const
self;
45
S
(): self (this) { }
46
S
(
const
S
&
s
): self (this) {
pass
=
pass
&& &
s
==
s
.
self
; }
47
S
(
double
): self (this) { }
48
~S
() {
pass
=
pass
&&
this
== self; }
49
operator
double ()
const
{
pass
=
pass
&&
this
== self;
return
1.0; }
50
51
void
operator=
(
const
S
&
s
) {
52
pass
=
pass
&& &
s
==
s
.self &&
this
== self;
53
}
54
S
operator-
()
const
{
pass
=
pass
&&
this
== self;
return
*
this
; }
55
bool
operator<
(
const
S
&
s
)
const
{
56
pass
=
pass
&& &
s
==
s
.
self
&&
this
== self;
57
return
false
;
58
}
59
};
60
61
62
int
main
()
63
{
64
const
S
s
;
65
const
std::valarray<S>
a
(2);
66
67
int
nfails = 0;
68
69
#define TEST(fun, args) \
70
pass = true; \
71
fun args; \
72
if (!pass) { \
73
std::fprintf (stderr, "std::%s uses uninitialized storage\n", \
74
#fun); \
75
++nfails; \
76
} (void)0
77
78
TEST
(
abs
, (
a
));
79
TEST
(acos, (
a
));
80
TEST
(asin, (
a
));
81
TEST
(atan, (
a
));
82
TEST
(atan2, (
a
,
a
));
83
TEST
(atan2, (
a
,
s
));
84
TEST
(atan2, (
s
,
a
));
85
TEST
(cos, (
a
));
86
TEST
(cosh, (
a
));
87
TEST
(exp, (
a
));
88
TEST
(log, (
a
));
89
TEST
(log10, (
a
));
90
TEST
(pow, (
a
,
a
));
91
TEST
(pow, (
a
,
s
));
92
TEST
(pow, (
s
,
a
));
93
TEST
(sin, (
a
));
94
TEST
(sinh, (
a
));
95
TEST
(sqrt, (
a
));
96
TEST
(tan, (
a
));
97
TEST
(tanh, (
a
));
98
99
assert
(0 == nfails);
100
101
return
0;
102
}
a
#define a
Definition
17.names.cpp:109
s
#define s
Definition
rw_alg_test.h:221
operator-
const minus< T > & operator-(const minus< T > &lhs, const minus< T > &rhs)
Definition
26.adjacent.diff.cpp:49
pass
bool pass
Definition
26.valarray.transcend.stdcxx-315.cpp:41
TEST
#define TEST(fun, args)
main
int main()
Definition
26.valarray.transcend.stdcxx-315.cpp:62
abs
T abs(T t)
Definition
ABS_OVERLOADS.cpp:46
assert
#define assert(expr)
Definition
_cassert.h:40
operator<
bool operator<(const json_pointer< RefStringTypeLhs > &lhs, const json_pointer< RefStringTypeRhs > &rhs) noexcept
Definition
json.h:14787
S
Definition
COLLAPSE_TEMPLATE_STATICS.cpp:40
S::~S
~S()
Definition
26.valarray.transcend.stdcxx-315.cpp:48
S::operator=
void operator=(const S &s)
Definition
26.valarray.transcend.stdcxx-315.cpp:51
S::S
S(double)
Definition
26.valarray.transcend.stdcxx-315.cpp:47
S::S
S(const S &s)
Definition
26.valarray.transcend.stdcxx-315.cpp:46
S::self
const S *const self
Definition
26.valarray.cshift.stdcxx-316.cpp:36
S::S
S()
Definition
26.valarray.transcend.stdcxx-315.cpp:45
std::bad_alloc
Definition
EXCEPTION_SPECIFICATION_ON_NEW.cpp:34
Generated by
1.9.8