-
Notifications
You must be signed in to change notification settings - Fork 3
/
index_printing.C
83 lines (54 loc) · 1.56 KB
/
index_printing.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include "index_printing.h"
std::ostream& operator<<(std::ostream& os, const libresponse::type::indices& i)
{
const size_t size = i.size();
os << " size: " << size << std::endl;
for (size_t s = 0; s < size; s++) {
os << " block " << s << std::endl;
os << i.at(s);
}
return os;
}
std::ostream& operator<<(std::ostream& os, const libresponse::type::pair_indices& pi)
{
os << " pair (first)" << std::endl;
os << pi.first;
os << " pair (second)" << std::endl;
os << pi.second;
return os;
}
std::ostream& operator<<(std::ostream& os, const libresponse::type::pair_arma& pa)
{
os << " pair (first)" << std::endl;
os << pa.first;
os << " pair (second)" << std::endl;
os << pa.second;
return os;
}
std::ostream& operator<<(std::ostream& os, const libresponse::type::pair& p)
{
os << " (" << p.first << ", " << p.second << ")";
return os;
}
std::ostream& operator<<(std::ostream& os, const libresponse::type::pairs& ps)
{
libresponse::type::pairs_iterator it;
for (it = ps.begin(); it != ps.end(); ++it) {
os << *it << std::endl;
}
return os;
}
// template <typename T>
// std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
// typename std::vector<T>::const_iterator it;
// os << "[";
// for (it = v.begin(); it != v.end(); ++it) {
// if (it == v.end() - 1)
// os << *it;
// else
// os << *it << ", ";
// }
// os << "]" << std::endl;
// return os;
// }
// Don't need explicit instantiation?