Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #772

Re: Shouldn't there be a way to exclude member functions out of name lookup explicitly?

Path csiph.com!xmission!news.glorb.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date Tue, 18 Aug 2015 22:40:02 -0500
Return-Path <cppmods@glengoyne.dreamhost.com>
Sender std-cpp-request@vandevoorde.com
Approved james.dennett@gmail.com
Message-ID <ooadndWYEoBTBk7InZ2dnUU78d-dnZ2d@giganews.com> (permalink)
Newsgroups comp.std.c++
From Jakob Bohm <jb-usenet@wisemo.com>
Subject Re: Shouldn't there be a way to exclude member functions out of name lookup explicitly?
Organization WiseMo A/S
References <820594f6-b670-4dba-8254-26d352489616@googlegroups.com> <5e134e90-067e-4d71-bf40-c4396bfc52f4@googlegroups.com> <31d52d8d-796a-4b61-8e56-6da52f2136be@googlegroups.com> <NZKdnQZa84VGn1bInZ2dnUU78dGdnZ2d@giganews.com> <dac23163-d38e-477a-b1b6-ecd99e35ad52@googlegroups.com>
Content-Type text/plain; charset=windows-1252; format=flowed
X-Original-Date Tue, 18 Aug 2015 22:55:41 +0200
X-Submission-Address std-cpp-submit@vandevoorde.com
Date Tue, 18 Aug 2015 22:35:26 CST
Lines 87
X-Usenet-Provider http://www.giganews.com
X-Trace sv3-98o2zXPXR/gbKzjWp2PDTRlKxGrKdyHv6+OPoCb8LS+GwfQc6kr4su4eP6/Da6N2r1XVlFySmHY1fjF!X88D7fn0BVTsvvVw6sxkkXNHqeLkU9PWtNOp/YywlFFX0VbBMn/Q3EEdqs533LxYgxsApFc99UeQ
X-Complaints-To abuse@giganews.com
X-DMCA-Notifications http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 4448
X-Received-Bytes 4560
X-Received-Body-CRC 3770194771
Xref csiph.com comp.std.c++:772

Show key headers only | View raw


On 17/08/2015 01:29, Johannes Gerd Becker wrote:

>
> ...
>>>
>>> Why can I write
>>>
>>> using namespace std;
>>> auto i = begin (vec);
>>>
>>> everywhere in my code, yet not within a class that has a member functio=
n
>>> named begin ()?
>>>
>>> ...
>>>
>>
>> Doesn't the existing :: qualifier do this already:
>>
>> auto i == ::begin(vec); // ADL
>>
>> Or did I miss some unfortunate interaction with the way named namespaces
>> were formally added to the language?
>>
>>
> No, it doesn't.
>
> ::begin is considered as a qualified id, and ADL is not done for qualifie=
d
> ids ([basic.lookup.argdep], paragraph 1). ::begin will always only refer =
to
> the global namespace ([basic.lookup.qual], paragraph 4).
>
>
Just to expand your statements for clarity, you seem to be saying two of
the following three things:

1. Qualified ids such as Foo::Bar(7, 'A') and ::Bar(7, 'A') are not
  looked up based on their argument types, thus greatly reducing the
  ability to invoke overloaded functions????

2. Qualified ids such as Foo::Bar(7, 'A') and ::Bar(7, 'A') are not
  searched outside their specified scope/namespace, even if an outer
  scope/namespace provides a more appropriate overloaded function????

3. The Global Scope prefix :: operator also excludes any non-class
  namespaces brought in via the using keyword, including the "std"
  namespace????

#3 is the unfortunate interaction I alluded to in my previous post.

If you are saying just #2 and #3, I am a bit confused what the original
problem was:

A. Unqualified ids such as Bar(7, 'A') are not searched beyond the
  first found scope containing an identifier Bar, even if that
  identifier has the wrong type for its arguments.

B. Unqualified ids such as Bar(7, 'A') are not searched beyond the
  first found scope containing an identifier Bar, even if that
  identifier has the wrong type for its arguments, but only if that
  first found scope is a class declaration.

C. Limitation A or B applies only to some language implementations or
  to some editions of the standard.

In either case, I am still wondering why the exemplified issue cannot be
handled directly with a Qualified Id, specifically which (2 or more) scopes
do you want the template implementation to search for identifier begin().


Enjoy

Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S.  https://www.wisemo.com
Transformervej 29, 2860 S=C3=B8borg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded


[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Shouldn't there be a way to exclude member functions out of name  lookup explicitly? Johannes Gerd Becker <johannes.gerd.becker@googlemail.com> - 2015-07-27 11:22 -0600
  Shouldn't there be a way to exclude member functions out of name   lookup explicitly? Anton Bikineev <ant.bikineev@googlemail.com> - 2015-07-30 11:54 -0600
    Re: Shouldn't there be a way to exclude member functions out of name    lookup explicitly? Johannes Gerd Becker <johannes.gerd.becker@googlemail.com> - 2015-08-01 21:09 -0600
      Re: Shouldn't there be a way to exclude member functions out of name lookup explicitly? Jakob Bohm <jb-usenet@wisemo.com> - 2015-08-12 13:00 -0600
        Re: Shouldn't there be a way to exclude member functions out of name  lookup explicitly? Johannes Gerd Becker <johannes.gerd.becker@googlemail.com> - 2015-08-16 17:29 -0600
          Re: Shouldn't there be a way to exclude member functions out of name lookup explicitly? Jakob Bohm <jb-usenet@wisemo.com> - 2015-08-18 22:35 -0600
  Re: Shouldn't there be a way to exclude member functions out of name  lookup explicitly? Richard Smith <richard@ex-parrot.com> - 2015-08-20 01:10 -0600
    Re: Shouldn't there be a way to exclude member functions out of name   lookup explicitly? Johannes Gerd Becker <johannes.gerd.becker@googlemail.com> - 2015-08-21 19:14 -0600

csiph-web