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.members.stdcxx-313.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
S
& operator= (
const
S
&
s
) {
53
assert
(
this
== self && &
s
==
s
.
self
);
54
return
*
this
;
55
}
56
};
57
58
59
S
foo
(
S
s
) {
return
s
; }
60
S
bar
(
const
S
&
s
) {
return
s
; }
61
62
63
int
main
()
64
{
65
const
std::valarray<S>
a
(2);
66
67
a
.apply (
foo
);
68
a
.apply (
bar
);
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
main
int main()
Definition
26.valarray.members.stdcxx-313.cpp:63
bar
int bar()
Definition
collapse_static_locals.lib.cpp:36
foo
#define foo(buf, s,...)
Definition
VA_LIST_FUNC_MACRO.cpp:28
assert
#define assert(expr)
Definition
_cassert.h:40
foo
Definition
VARIADIC_TEMPLATES.cpp:25
S
Definition
COLLAPSE_TEMPLATE_STATICS.cpp:40
S::~S
~S()
Definition
26.valarray.members.stdcxx-313.cpp:51
S::S
S(const S &s)
Definition
26.valarray.members.stdcxx-313.cpp:50
S::self
const S *const self
Definition
26.valarray.cshift.stdcxx-316.cpp:36
S::S
S()
Definition
26.valarray.members.stdcxx-313.cpp:49
std::bad_alloc
Definition
EXCEPTION_SPECIFICATION_ON_NEW.cpp:34
Generated by
1.9.8