Skip to content

Commit

Permalink
add logging for set
Browse files Browse the repository at this point in the history
  • Loading branch information
fedimser committed May 7, 2024
1 parent 4f6c655 commit 685863f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
return os;
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& v) {
bool c = false;
os << "{";
for (const T &x : v) {
if (c) {
os << ",";
} else {
c = true;
}
os << x;
}
os << "}";
return os;
}

template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, const std::map<T1, T2>& m) {
bool c = false;
Expand Down

0 comments on commit 685863f

Please sign in to comment.