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

gdr at integrable-solutions dot net gcc-bugzilla@gcc.gnu.org
Tue Aug 3 15:05:00 GMT 2004


------- Additional Comments From gdr at integrable-solutions dot net  2004-08-03 15:05 -------
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:

| gdr at integrable-solutions dot net wrote:
| 
| >> Because I think that picking up std::distance by Koenig lookup and
| >> having it *abort compilation* instead of being reject as an invalid
| >> overload is just an unintended side effect of the implementation.
| >
| > I'm more interested in chapter and verse, since you stated that this
| > is a reject-valid.
| 
| I don't see anything in the standard that tells me I cannot define a function
| called "distance" in the global namespace. Nor that if I do it, I must call it
| with an explicit scope specification. Hence, the code is valid,

If you're unable to produce chapter and verse as to why the code is
valid, then you're out of luck.  

| just like I can
| define a function named "distance2". Bring me your chapter and verse which
| tells that the code is ill-formed.

See the rather excellent explanation given by Wolfgang.  If you ever
happen to disagree with any of his technical points, please just point
it out instead of confusing what the standard says with what you would
like it to say.

| Really, are you implying that the committee *explicitally* wanted to

Please, do not put words in my mouth. 

| avoid such a case while writing the standard? It looks obvious to me
| that it would be 
| *great* if the code worked as-is,

It would be greate != it is valid according to the standard.
There are lots of things out there it would be great if they worked.

| and it is just an unfortunate chain of events
| (complex language rules) which break compilation.

If you believe the standard is broken, please take it up to the
standards committee and fix it.

| I doubt we will ever going to agree here, Gaby. Really, I doubt it. The core

That does not make prevent me from sleeping.

| here is: I think it is correct by large common sense, I think it is crystal
| clear that it is correct. 

  On appelle idées claires, celle qui sont au même degré de
  confusion que les siennes.

| So crystal clear that it took about 10 comments to
| Wolfgang and me[1] understand why GCC was rejecting the code. 

The fact that you're insisting in confusing your desire with actual
wording is not germane to that number of comments.

| You are defending
| side-effects of complex language rules on normal-looking code as an explanation
| of why it is invalid. You have the right of doing so, of course. Moreover, you

Please, stop putting words in mouth.  I'm not defending a language rule.
You came and tell people that this is a reject-valid PR.  The minimum
thing to do is to produce a chapter and verse or a chain of logical
inferences of why that is so.  Instead, you're telling people that it
would be great if it worked.  That is called a wishful thinking.

| are the v3 maintainer, so I think I am out of luck here.
| 
| Giovanni Bajo
| 
| [1] and we both know C++ at a decent level, I presume.

I'm not questionning your level of C++ understanding.  I asked a
rather different question.

-- Gaby


-- 


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



More information about the Gcc-bugs mailing list