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.unary.stdcxx-314.cpp
Go to the documentation of this file.
1
29
#include <cassert>
30
#include <cstdlib>
31
#include <cstring>
32
#include <new>
33
#include <valarray>
34
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
void
operator
delete
(
void
*
ptr
)
throw
()
42
{
43
std::free (
ptr
);
44
}
45
46
47
struct
S
{
48
const
S
*
const
self
;
49
S
(): self (this) { }
50
S
(
const
S
&
s
): self (this) {
assert
(&
s
==
s
.self); }
51
~S
() {
assert
(
this
== self); }
52
53
S
operator+
()
const
{
assert
(
this
== self);
return
*
this
; }
54
S
operator-
()
const
{
assert
(
this
== self);
return
*
this
; }
55
S
operator~ ()
const
{
assert
(
this
== self);
return
*
this
; }
56
bool
operator! ()
const
{
assert
(
this
== self);
return
false
; }
57
58
void
operator= (
const
S
&
s
) {
assert
(
this
== self && &
s
==
s
.
self
); }
59
};
60
61
int
main
()
62
{
63
const
std::valarray<S>
a
(2);
64
65
+
a
;
66
-
a
;
67
~a;
68
!
a
;
69
}
ptr
#define ptr
Definition
17.names.cpp:525
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
main
int main()
Definition
26.valarray.unary.stdcxx-314.cpp:61
operator+
void operator+(typename A< T >::I, const A< T > &)
assert
#define assert(expr)
Definition
_cassert.h:40
S
Definition
COLLAPSE_TEMPLATE_STATICS.cpp:40
S::~S
~S()
Definition
26.valarray.unary.stdcxx-314.cpp:51
S::S
S(const S &s)
Definition
26.valarray.unary.stdcxx-314.cpp:50
S::self
const S *const self
Definition
26.valarray.cshift.stdcxx-316.cpp:36
S::S
S()
Definition
26.valarray.unary.stdcxx-314.cpp:49
std::bad_alloc
Definition
EXCEPTION_SPECIFICATION_ON_NEW.cpp:34
Generated by
1.9.8