Item 25. Argument Dependent Lookup
Namespaces have a pervasive influence on modern C++ programs and designs (see Namespaces [23, 81]). Some of these influences are immediately obvious, such as the presence of using declarations and directives and qualification of names with namespace scope. However, namespaces have less syntactically obvious influences that are nevertheless as basic and important. Argument dependent lookup (ADL) is one of these. Like many C++ features, ADL has the potential to be complex, but in common use it is straightforward and solves many more problems than it introduces.
The idea behind ADL is simple. When looking up the name of a function in a function call expression, the compiler will also examine namespaces that contain ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access