Skip to content

Instantly share code, notes, and snippets.

@fischman
Created March 12, 2012 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fischman/2023705 to your computer and use it in GitHub Desktop.
Save fischman/2023705 to your computer and use it in GitHub Desktop.
#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