public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15910] New: can't compile self defined void distance(std::vector<T>, std::vector<T>)
@ 2004-06-10 14:39 king dot benjamin at mh-hannover dot de
  2004-06-10 14:42 ` [Bug c++/15910] " king dot benjamin at mh-hannover dot de
                   ` (102 more replies)
  0 siblings, 103 replies; 109+ messages in thread
From: king dot benjamin at mh-hannover dot de @ 2004-06-10 14:39 UTC (permalink / raw)
  To: gcc-bugs

The following program does not compile:

-----
#include <vector>
 
double distance(const std::vector<double> & v1, const std::vector<double> & v2) 
{
  return 0;
}
 
int main(int argc, char* argv[])
{
  std::vector<double> v;
  double d;
  d = distance(v, v);
  return 0;
}
----

In response to a post to gcc-bugs@gcc.gnu.org, Jim Wilson wrote:

----
I am not a C++ expert, so I am really not the right person to be looking at 
this.  However, I suspect the problem is that the vector 
class is itself defined in namespace std, and uses the iterator classes, and 
that is somehow causing the search for the distance 
function to also look at the interator classes.  It isn't just the name 
distance, any name in stl_interator.h seems to cause the 
same problem.
 
I can get your testcase to compile if I change
  d = distance(v, v);
to
  d = ::distance(v, v);
----

-- 
           Summary: can't compile self defined void distance(std::vector<T>,
                    std::vector<T>)
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: king dot benjamin at mh-hannover dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: 3.3.2
  GCC host triplet: 3.3.2
GCC target triplet: 3.3.2


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


^ permalink raw reply	[flat|nested] 109+ messages in thread

end of thread, other threads:[~2005-08-12 14:03 UTC | newest]

Thread overview: 109+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-10 14:39 [Bug c++/15910] New: can't compile self defined void distance(std::vector<T>, std::vector<T>) king dot benjamin at mh-hannover dot de
2004-06-10 14:42 ` [Bug c++/15910] " king dot benjamin at mh-hannover dot de
2004-06-10 14:44 ` king dot benjamin at mh-hannover dot de
2004-06-10 14:45 ` bangerth at dealii dot org
2004-06-10 15:17 ` giovannibajo at libero dot it
2004-06-10 16:01 ` pinskia at gcc dot gnu dot org
2004-06-10 16:04 ` giovannibajo at libero dot it
2004-06-10 16:08 ` giovannibajo at libero dot it
2004-06-10 16:17 ` bangerth at dealii dot org
2004-06-10 16:23 ` [Bug libstdc++/15910] " giovannibajo at libero dot it
2004-06-10 16:24 ` giovannibajo at libero dot it
2004-06-10 17:38 ` bangerth at dealii dot org
2004-06-11  0:01 ` giovannibajo at libero dot it
2004-06-11  0:59 ` giovannibajo at libero dot it
2004-08-03 10:33 ` pcarlini at suse dot de
2004-08-03 10:44 ` giovannibajo at libero dot it
2004-08-03 10:50 ` pcarlini at suse dot de
2004-08-03 11:15 ` pcarlini at suse dot de
2004-08-03 11:17 ` giovannibajo at libero dot it
2004-08-03 11:30   ` Gabriel Dos Reis
2004-08-03 11:27 ` gdr at gcc dot gnu dot org
2004-08-03 11:29 ` gdr at gcc dot gnu dot org
2004-08-03 11:30 ` gdr at integrable-solutions dot net
2004-08-03 11:33 ` gdr at gcc dot gnu dot org
2004-08-03 11:38 ` gdr at gcc dot gnu dot org
2004-08-03 12:48 ` giovannibajo at libero dot it
2004-08-03 13:01 ` gdr at integrable-solutions dot net
2004-08-03 13:04 ` bangerth at dealii dot org
2004-08-03 13:14 ` giovannibajo at libero dot it
2004-08-03 13:21 ` giovannibajo at libero dot it
2004-08-03 13:28 ` pcarlini at suse dot de
2004-08-03 13:32 ` giovannibajo at libero dot it
2004-08-03 13:44 ` bangerth at dealii dot org
2004-08-03 13:52 ` giovannibajo at libero dot it
2004-08-03 15:05 ` gdr at integrable-solutions dot net
2004-08-03 15:08 ` gdr at integrable-solutions dot net
2004-08-03 15:16 ` gdr at integrable-solutions dot net
2004-08-03 15:19 ` gdr at integrable-solutions dot net
2004-08-03 17:44 ` giovannibajo at libero dot it
2004-08-03 18:12 ` pinskia at gcc dot gnu dot org
2004-08-03 18:20 ` gdr at integrable-solutions dot net
2004-08-03 18:24 ` gdr at integrable-solutions dot net
2004-08-03 18:25 ` bangerth at dealii dot org
2004-08-03 18:25 ` bangerth at dealii dot org
2004-08-03 18:26 ` bangerth at dealii dot org
2005-08-03 12:57 ` pinskia at gcc dot gnu dot org
2005-08-03 13:03 ` pinskia at gcc dot gnu dot org
2005-08-04  5:27 ` adah at netstd dot com
2005-08-04 10:13 ` gdr at integrable-solutions dot net
2005-08-05  5:41 ` adah at netstd dot com
2005-08-05 13:10 ` bangerth at dealii dot org
2005-08-06 11:58 ` gdr at integrable-solutions dot net
2005-08-06 17:18 ` bangerth at dealii dot org
2005-08-08  2:26 ` adah at netstd dot com
2005-08-08  3:53 ` adah at netstd dot com
2005-08-08  4:56 ` gdr at integrable-solutions dot net
2005-08-08  4:59 ` gdr at integrable-solutions dot net
2005-08-08  6:19 ` adah at netstd dot com
2005-08-08  6:31 ` adah at netstd dot com
2005-08-08 10:25 ` gdr at integrable-solutions dot net
2005-08-08 10:29 ` gdr at integrable-solutions dot net
2005-08-08 12:56 ` adah at netstd dot com
2005-08-08 13:21 ` bangerth at dealii dot org
2005-08-08 18:08 ` gdr at integrable-solutions dot net
2005-08-09  1:45 ` adah at netstd dot com
2005-08-09  8:35 ` gdr at integrable-solutions dot net
2005-08-09 10:49 ` adah at netstd dot com
2005-08-09 11:07 ` gdr at integrable-solutions dot net
2005-08-09 13:26 ` adah at netstd dot com
2005-08-09 13:36 ` adah at netstd dot com
2005-08-09 13:40   ` Andrew Pinski
2005-08-09 13:40 ` pinskia at physics dot uc dot edu
2005-08-09 14:12 ` bangerth at dealii dot org
2005-08-09 17:28 ` gdr at integrable-solutions dot net
2005-08-09 17:36 ` gdr at integrable-solutions dot net
2005-08-10  2:41 ` adah at netstd dot com
2005-08-10  2:49   ` Andrew Pinski
2005-08-10  2:49 ` pinskia at physics dot uc dot edu
2005-08-10  3:11 ` adah at netstd dot com
2005-08-10  3:17 ` pinskia at gcc dot gnu dot org
2005-08-10  3:35 ` adah at netstd dot com
2005-08-10  4:32 ` adah at netstd dot com
2005-08-10 11:35 ` gdr at integrable-solutions dot net
2005-08-11  2:01 ` adah at netstd dot com
2005-08-11  3:51 ` adah at netstd dot com
2005-08-11  6:31 ` gdr at integrable-solutions dot net
2005-08-11  6:46 ` gdr at integrable-solutions dot net
2005-08-12  2:10 ` adah at netstd dot com
2005-08-12  2:14   ` Andrew Pinski
2005-08-12  2:14 ` pinskia at physics dot uc dot edu
2005-08-12  2:32 ` adah at netstd dot com
2005-08-12  2:38   ` Andrew Pinski
2005-08-12  2:38 ` pinskia at physics dot uc dot edu
2005-08-12  3:00 ` adah at netstd dot com
2005-08-12  3:39 ` gdr at integrable-solutions dot net
2005-08-12  3:41 ` gdr at integrable-solutions dot net
2005-08-12  3:45 ` gdr at integrable-solutions dot net
2005-08-12  3:47 ` adah at netstd dot com
2005-08-12  4:05 ` bangerth at dealii dot org
2005-08-12  4:06 ` gdr at integrable-solutions dot net
2005-08-12  5:12 ` adah at netstd dot com
2005-08-12  6:19 ` gdr at integrable-solutions dot net
2005-08-12  8:52 ` adah at netstd dot com
2005-08-12  9:05 ` gdr at integrable-solutions dot net
2005-08-12  9:24 ` adah at netstd dot com
2005-08-12  9:44 ` gdr at integrable-solutions dot net
2005-08-12 10:50 ` adah at netstd dot com
2005-08-12 11:46 ` gdr at integrable-solutions dot net
2005-08-12 14:03 ` adah at netstd dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).