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


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

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

Message-ID <dac23163-d38e-477a-b1b6-ecd99e35ad52@googlegroups.com> (permalink)
Newsgroups comp.std.c++
From Johannes Gerd Becker <johannes.gerd.becker@googlemail.com>
Subject Re: Shouldn't there be a way to exclude member functions out of name lookup explicitly?
Organization unknown
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>
Date 2015-08-16 17:29 -0600

Show all headers | View raw


> > ...
> >
> > Why can I write
> >
> > using namespace std;
> > auto i = begin (vec);
> >
> > everywhere in my code, yet not within a class that has a member function
> > 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?
>
>
> 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

No, it doesn't.

::begin is considered as a qualified id, and ADL is not done for qualified
ids ([basic.lookup.argdep], paragraph 1). ::begin will always only refer to
the global namespace ([basic.lookup.qual], paragraph 4).

Best,
Johannes


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