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
examples
include
valarray.h
Go to the documentation of this file.
1
30
#ifndef VALARRAY_H_INCLUDED
31
#define VALARRAY_H_INCLUDED
32
33
34
#include <valarray>
35
#include <ostream>
36
37
#include <
examples.h
>
38
39
template
<
class
T>
40
inline
std::ostream&
41
insert_valarray
(std::ostream &
out
,
const
std::valarray<T> &
v
)
42
{
43
out
<<
"["
;
44
for
(std::size_t
i
= 0;
i
<
v
.size ();
i
++) {
45
out
<<
v
[
i
];
46
if
(
i
<
v
.size () - 1)
47
out
<<
","
;
48
}
49
return
out
<<
"]"
;
50
}
51
52
// Non-templatized insertion operators necessary for implicit
53
// conversion from slice_array<T> (etc.) to valarray<T>. (the
54
// conversion won't work in template argument deduction).
55
inline
std::ostream&
operator<<
(std::ostream &
out
,
const
std::valarray<int> &
v
)
56
{
57
return
insert_valarray
(
out
,
v
);
58
}
59
60
std::ostream&
operator<<
(std::ostream &
out
,
const
std::valarray<bool> &
v
)
61
{
62
return
insert_valarray
(
out
,
v
);
63
}
64
65
#endif
// VALARRAY_H_INCLUDED
i
#define i
Definition
17.names.cpp:126
v
#define v
Definition
17.names.cpp:138
out
const int out
Definition
27.stringbuf.virtuals.cpp:443
examples.h
operator<<
std::ostream & operator<<(std::ostream &out, const std::valarray< int > &v)
Definition
valarray.h:55
insert_valarray
std::ostream & insert_valarray(std::ostream &out, const std::valarray< T > &v)
Definition
valarray.h:41
Generated by
1.9.8