------- Additional Comments From gdr at integrable-solutions dot net 2005-08-10 11:35 ------- Subject: Re: can't compile self defined void distance(std::vector<T>, std::vector<T>)
"adah at netstd dot com" <[EMAIL PROTECTED]> writes: | Now to your point. Please notice that my current stance is not that | GCC should fix this `bug'. I have stated it days ago. But the | user's failure is really UNEXPECTED, and this is a PROBLEM. Please, do consider that the outcome of this is the specification of "argument dependent name lookup". It is the same rules that apply whether the function is called "distance" or "freebies" and the namespace is called "std" or "foobar". Just saying, "ah, this is std, therefore the outcome is unexpected" is not sufficient. To appreciate the issue and argue you NEED to understand the rules. Furthermore, and more importantly, GCC bugzilla is the not the place to record UNEXPECTED or PROBLEM with the C++ standard. | To avoid this problem, a better diagnostic message should be | emitted. Just try compiling the OP's program to see my point. Just consider how you would formulate the rules for name lookup to appreciate the point people are making here. There is no magic. We don't have the keyword "readmymind". [...] | I cannot help wondering why (though this might be better discussed | on comp.std.c++: I do hope you can discuss there). IMHO, the | current bahaviour is violating the rationale of the std namespace. You seem to focuse on namespace std, without understanding that this issue has nothing particular to do with std. Would have the issue have been different if the namespace was called std? If you think yes, then I suggest you give it more thoughts. [...] | c) Failure to instantiate a template function should automatically remove it | from the candidates of overload resolution. If you want to modify standard rules, please, again take it to the committee in charge of C++. -- Gaby -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15910