Where should I define operator >> for my specialization of std::pair?
Consider the following program: #include <iostream> #include <iterator> #include <vector> #include <utility> using namespace std; //just for convenience, illustration only typedef pair<int, int> point; //this is my specialization of pair. I call it point istream& operator >> (istream & in, point & p) { return in >> p.first >> p.second; } int main() { vector<point> v((istream_iterator<point>(cin)), istream_iterator<point>()); // ^^^ ^^^ //extra parentheses lest this should be mistaken for a function declaration } This fails to compile because as soon as ADL finds operator >> in namespace std it