This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/15910] can't compile self defined void distance(std::vector<T>, std::vector<T>)
- From: "adah at netstd dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Aug 2005 05:41:13 -0000
- Subject: [Bug libstdc++/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 adah at netstd dot com 2005-08-05 05:41 -------
(In reply to comment #44)
> | However, I still believe it is the problem of the compilers.
> Please take ti to the C++ standard committee. The behaviour is that
> described by the standard. If you don't like it, have the committee
The behaviour I wanted is at least not *against* the standard, while being more
natural and user-friendly. As James Kanze quoted §14.7.1/5 in
comp.lang.c++.moderated: "If the overload resolution process can determine the
correct function to call without instantiating a class template definition, it
is unspecified whether that instantiation actually takes place."
BTW, proposal N1799 directly addresses this problem and, if adopted, will make
the program we are discussing legal instead of unspecified behaviour.
> change it. If you think name lookup is an easy exercise, give it a try.
I never thought any part of a C++ compiler is easy. I just try to express my
opinions on this subject, as a common gcc user (I myself do *not* define any
functions named distance).
> -- Gaby
Yongwei
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15910