Hi, > I have attached a cpp file that (I believe) should compile (and does on > Borland c++). It is the copy at the end that causes a problem - the > while loop is simply doing the same as what the copy should do (just to > show I did the operator<< properly). Copy works for other cases (ints, > floats, etc) and even for my own structs too. I'm just not sure why it > complains about the operator<< function for a std::pair.
The short answer is that the behavior implemented by GCC is correct, according to the ISO C++ Standard. Of course I agree that it's somewhat unexpected: you may want to have a look to this thread, for instance: http://tinyurl.com/dtxrx Paolo.