Talk:Argument-dependent name lookup

Move page?
As Koenig lookup is the colloqual name for what the C++ standard calls argument dependent name lookup, should the page moved from Koenig lookup to argument dependent name lookup and Koenig lookup turned into a redirect? &mdash;Tobias Bergemann 08:58, 12 February 2006 (UTC)
 * Yes. —Ben FrantzDale 23:01, 25 September 2006 (UTC)

Error in Criticism section?
"...Furthermore, if for some reason both N::swap(N::A&, N::A&) and std::swap(N::A&, N::A&) are defined, then the first example will call std::swap(N::A&, N::A&) but the second will not compile because swap(a, b) would be ambiguous..."

Since std::swap is a function template and it is only allowed to specialize templates but not to add other declarations (overloading) in the std::namespace it makes sense to specialize std::swap (if possible). std::swap would still be a template. Overload resolution prefers non-templates. So there won't be an ambiguity. For user-defined class templates this is a different story: std::swap can't be partially specialized. So, there's nothing that can be done to make std::swap behave differently for some class template. This is a good reason to write "using std::swap; swap(a,b)" instead of "std::swap(a,b)" in generic code. In fact, ADL solves this problem nicely: The most "specialized" function is selected including functions of other namespaces via ADL. Zerpi (talk) 08:36, 12 March 2009 (UTC)

Error in Example section
Everyone seems to be claiming all over the internet that: std::cout << "hello" << std::endl; doesn't compile without ADL.

This is WRONG. Please stop propagating this misconception.

I agree, the correct example should be something like this: std::string hello="hello"; std::cout << hello << std::endl; It's necessary to remove current wrong example, or, even better, introduce both examples with explanation why one requires ADL and the other doesn't. Anyone ready to do that? — Preceding unsigned comment added by 62.141.227.102 (talk) 16:33, 22 July 2013 (UTC)

Andrew Koenig explains everything there is to know about ADL here: http://www.drdobbs.com/cpp/a-personal-note-about-argument-dependent/232901443 — Preceding unsigned comment added by 155.140.255.119 (talk) 01:38, 11 July 2013 (UTC)

Koenig claims not to be the inventor
On Dr. Dobbs Koenig recently pointed to Wikipedia refusing he did invent ADL. — Preceding unsigned comment added by 80.108.4.211 (talk) 11:39, 8 August 2012 (UTC)

"claims"? "refusing"? He said he isn't the inventor ... therefore he isn't the inventor. He also noted that the rest of the article is wrong ... the code that it is claimed won't compile will compile, and the actual problem (that something like std::string::operator<< can't be found without ADL) is not discussed. -- 96.248.226.133 (talk) 19:15, 2 December 2012 (UTC)
 * So please do suppress the sentence saying that Koenig is the inventor !!!  Ptyxs (talk) 08:08, 14 May 2013 (UTC)