This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


------- Additional Comments From gdr at integrable-solutions dot net  2004-08-03 15:08 -------
Subject: Re:  can't compile self defined void distance(std::vector<T>, std::vector<T>)

"giovannibajo at libero dot it" <gcc-bugzilla@gcc.gnu.org> writes:

| bangerth at dealii dot org wrote:
| 
| > However,
| > I don't know whether the standard allows us to actually check these
| > requirements on template arguments in a way that not only rejects a
| > program in which they are not satisfied, but rather
| > _reject a given function from the overload set_ and allows us to pick
| > a different function.
| 
| You do realize that this happens only because ::distance() is defined with name
| "distance", has 2 parameters, and it is called with (at least) one argument
| from namespace std, right? Do you really believe it makes sense to reject this
| very special situation and allow any other orthogonally similar use of such a
| function?

What he believes make sense is different what what actually makes the
code valid or invalid.  
We're not going to fix random broken users codes.
The real issue is deeper than you seem to realize. 
Focusing on "distance" is in the tradition of the usual myopic view
where we consider things in small until they blow up in our hands.
If you want to fix the language, please take it to the committee.

-- Gaby


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]