-
Notifications
You must be signed in to change notification settings - Fork 3
/
index_printing.h
37 lines (29 loc) · 1.06 KB
/
index_printing.h
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
#ifndef LIBRESPONSE_INDEX_PRINTING_H_
#define LIBRESPONSE_INDEX_PRINTING_H_
/*!
* @brief Enable printing to streams for all typedefs.
*
* @file
*/
#include "typedefs.h"
std::ostream& operator<<(std::ostream& os, const libresponse::type::indices& i);
std::ostream& operator<<(std::ostream& os, const libresponse::type::pair_indices& pi);
std::ostream& operator<<(std::ostream& os, const libresponse::type::pair_arma& pa);
std::ostream& operator<<(std::ostream& os, const libresponse::type::pair& p);
std::ostream& operator<<(std::ostream& os, const libresponse::type::pairs& ps);
// template <typename T>
// std::ostream& operator<<(std::ostream& os, const std::vector<T>& v);
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;
};
#endif // LIBRESPONSE_INDEX_PRINTING_H_