Skip to content

Commit 685863f

Browse files
committed
add logging for set
1 parent 4f6c655 commit 685863f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

debug.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@ std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
2020
return os;
2121
}
2222

23+
template <class T>
24+
std::ostream& operator<<(std::ostream& os, const std::set<T>& v) {
25+
bool c = false;
26+
os << "{";
27+
for (const T &x : v) {
28+
if (c) {
29+
os << ",";
30+
} else {
31+
c = true;
32+
}
33+
os << x;
34+
}
35+
os << "}";
36+
return os;
37+
}
38+
2339
template <typename T1, typename T2>
2440
std::ostream& operator<<(std::ostream& os, const std::map<T1, T2>& m) {
2541
bool c = false;

0 commit comments

Comments
 (0)