This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15910] can't compile self defined void distance(std::vector<T>, std::vector<T>)
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jun 2004 14:45:30 -0000
- Subject: [Bug c++/15910] can't compile self defined void distance(std::vector<T>, std::vector<T>)
- References: <20040610143911.15910.king.benjamin@mh-hannover.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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