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  2005-08-12 06:19 -------
Subject: Re:  can't compile self defined void distance(std::vector<T>, std::vector<T>)

"adah at netstd dot com" <gcc-bugzilla@gcc.gnu.org> writes:

| Herb Sutter's opinion (N1792) is a little different.  He thinks that
| ADL should not work in the OP's example, because distance is simply
| not an `interface' of std::vector (technically, instead of from
| human eyes).  But it is also self-consistent.

All those are assertions, little evidence.  Notice that what is
considered an "interface" varies from one individual to another
individual.  And we just don't have a definition for it, so you're
still using your "human eyes" definition, i.e. projection of your own
wishes. 

I was in the room when ADL was discussed at the last meeting in Norway
-- and indeed, I was part of the people who fiercely encouraged Herb
to bring forward "his modest proposal" (and that does not mean I agree
with every word contained in the proposal, but my interest in getting
the issue addressed).  At that time, I was presenting possible ways
the concept proposal may reduce the uncontrolled power of ADL.  I have
suggested that you give a try to the exercise of "name lookup".  That
suggestion still holds.  Untill, you have done so it is almost certain
then you will completely miss its the depth and ramifications.  It is
no Herb's opinion against mine.  It is a matter of precisely and
consistently defining the rules so that the most common cases are
gotten right. No, it is not GCC's job.  Furthermore, if you want to
eliminate ADL effects; you have to break existing codes and ban ADL.
Herb's suggestion already breaks some existing reasonable codes -- and he
acknowledges that.  You can argue from your notion of engineering and
intuition, but that is all.  And you have to have everbody else's
notion of engineering and intuition intersect with your before moving.
Once, the rules get written and ADL isstill supported, one will always
find cases that is considered either "intuitively and obviously
correct" or "intuitively and obviously wrong".  The reason is very
simple: ADL was *designed on purpose* to make overload set across separate
scopes -- something which did not exist before.  Once you're given
that, all bets are off.  The only thing you can do is to work to get
what you consider to be the most common cases "intuitively and
obviously right".  And live with the rest. 

[...]

| it is safer to have a better diagnostice message *now*.

you get a better diagnostic when you can precisely spell out what
alternate rules can be or give a precise consistent algorithms.  You
haven't so far.  Just arguing. 

-- 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]