Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <iostream>
template<class T, class U>
std::ostream& operator<<(std::ostream& out, const std::pair<T,U>& p) {
return out << p.first << "," << p.second;
}
int main() {
std::pair<int, int> p(42, -1);
std::cerr << p << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment