In the C++ programming language, argument dependent lookup (ADL), or argument dependent name lookup, also known as Koenig lookup, applies to the lookup of an unqualified function name depending on the types of the arguments given to the function call. This behavior is named after Andrew Koenig. In ADL, other namespaces not considered during normal lookup may be searched. The set of namespaces to be searched depends on the types of the function arguments.
| Property | Value |
| dbpprop:abstract
|
- In the C++ programming language, argument dependent lookup (ADL), or argument dependent name lookup, also known as Koenig lookup, applies to the lookup of an unqualified function name depending on the types of the arguments given to the function call. This behavior is named after Andrew Koenig. In ADL, other namespaces not considered during normal lookup may be searched. The set of namespaces to be searched depends on the types of the function arguments. For a class A, there is a set of associated classes which make up its direct and indirect base classes. The set of associated namespaces for A is the namespace that contains A together with the namespaces containing A's associated classes. It is this set of associated namespaces that is searched for a function with an argument of type A. If the normal lookup of the unqualified name finds a class member function, then ADL does not occur. Otherwise, the set of declarations found by lookup is the union of the declarations found by normal lookup with the declarations found by looking in the set of associated namespaces. The canonical example of ADL looks like this: namespace NS class A; void f(A) int main NS::A a; f(a); //calls NS::f A common pattern in the Standard Template Library is to declare overloaded operators that will be found in this manner. For example, this simple Hello World program would not compile if it weren't for ADL: include<iostream> int main std::cout << "Hello World, where did operator<< come from?" << std::endl; return 0; Using << is equivalent to calling operator<<, which however lacks the std qualifier. In this case, function std::ostream& std::operator<< is found through ADL. Note that std::endl is a function but it needs full qualification, since it is used as an argument to operator<< .
- 実引数依存の名前探索 (じつひきすういぞんのなまえたんさく、ADL)とは、C++において関数呼出時に与えられた引数の型に依存して、呼び出す関数を探索 (lookup)する仕組みのことである。英語ではKoenig lookup、argument dependent lookup (ADL)、argument dependent name lookupなどと呼ばれる。なお、Koenig lookupとは、この仕組みをAndrew Koenigが提案したことにちなむ。
|
| dbpprop:hasPhotoCollection
| |
| dbpprop:reference
| |
| rdfs:comment
|
- In the C++ programming language, argument dependent lookup (ADL), or argument dependent name lookup, also known as Koenig lookup, applies to the lookup of an unqualified function name depending on the types of the arguments given to the function call. This behavior is named after Andrew Koenig. In ADL, other namespaces not considered during normal lookup may be searched. The set of namespaces to be searched depends on the types of the function arguments.
- 実引数依存の名前探索 (じつひきすういぞんのなまえたんさく、ADL)とは、C++において関数呼出時に与えられた引数の型に依存して、呼び出す関数を探索 (lookup)する仕組みのことである。英語ではKoenig lookup、argument dependent lookup (ADL)、argument dependent name lookupなどと呼ばれる。なお、Koenig lookupとは、この仕組みをAndrew Koenigが提案したことにちなむ。
|
| rdfs:label
|
- Argument dependent name lookup
- 実引数依存の名前探索
|
| owl:sameAs
| |
| skos:subject
| |
| foaf:page
| |
| is dbpprop:redirect
of | |