[Bug c++/15910] can't compile self defined void distance(std::vector<T>, std::vector<T>)

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Thu Jun 10 14:45:00 GMT 2004


------- Additional Comments From bangerth at dealii dot org  2004-06-10 14:45 -------
Jim is right -- the compiler looks into the namespace of the  
arguments when looking for a function 'distance' and therefore  
doesn't find the one in global namespace. It does find one  
in namespace std::, though, so tries to call it. In the  
process of this, it has to do some argument conversions, which  
fail -- this is what you get the error messages for.  
  
Jim already mentioned the correct way to write the program so  
that it compiles. Note that Intel's compiler also rejects this  
program.  
  
W.  

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15910



More information about the Gcc-bugs mailing list