Argument-dependent name lookup

In the C++ programming language, argument-dependent lookup (ADL), or argument-dependent name lookup,[1] applies to the lookup of an unqualified function name depending on the types of the arguments given to the function call. This behavior is also known as Koenig lookup, as it is often attributed to Andrew Koenig, though he is not its inventor.[2]

During argument-dependent lookup, other namespaces not considered during normal lookup may be searched where the set of namespaces to be searched depends on the types of the function arguments. Specifically, the set of declarations discovered during the ADL process, and considered for resolution of the function name, is the union of the declarations found by normal lookup with the declarations found by looking in the set of namespaces associated with the types of the function arguments.

  1. ^ "Working Draft, Standard for Programming Language C++" (PDF). JTC1/SC22/WG21. 19 October 2005. Chapter 3.4.2 – Argument-dependent name lookup – p. 2. Archived from the original (PDF) on 14 December 2005. Retrieved 13 March 2012.
  2. ^ "A Personal Note About Argument-Dependent Lookup". 3 May 2012. Archived from the original on 17 March 2018. Retrieved 7 February 2014.