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

gdr at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Aug 3 11:38:00 GMT 2004


------- Additional Comments From gdr at gcc dot gnu dot org  2004-08-03 11:38 -------
(In reply to comment #11)

> > Giovanni, are you convinced that this isn't really a gcc problem?
> 
> Well, let's put in this way: when I look at the testcase for this bug, it
> strikes me VERY ODD that it is not valid C++ code. If you name distance as
> distance2 it works. The name clash between ::distance() and std::distance()
> should not happen, it is not meant to happen (this is why there is a namespace
> std in the first place!), and it is just a side effect of the complexity of the
> language rules.

I don't buy that reasoning.
A class is not an iterator just because it happens to have 
a nested type named iterator_category.  Your SFINEA game does not
solve the fundamental problem.  It is just tryin to paper over the roots.
As such, I oppose any game to that effect in libstdc++.

-- Gaby


-- 


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



More information about the Gcc-bugs mailing list