July 21, 2025Jul 21 Let's revisit a core concept in C++: how the compiler finds the names you use in your code. From qualified and unqualified name lookups to the special case of Argument-Dependent Lookup (ADL), understanding these mechanisms is essential for writing clear and correct C++ programs. Three types of name lookups in C++ by Sandor Dargo From the article: Letâs get back to some basics this week and talk about name lookups in C++. In other words: when you refer to a symbol in your code, how does the compiler find it? Essentially, we can differentiate between three kinds of lookups: Qualified name lookup Unqualified name lookup Argument-Dependent Lookup (ADL) Letâs explore them in that order. Qualified Name Lookup The term qualified refers to symbols that are explicitly scoped using the :: operator. In other words, these are names that appear to the right of a ::, such as x in a::b::x. Before the compiler can perform a qualified name lookup, it must first resolve the left-hand side of the :: operator. This identifies the namespace or class being referenced. Qualified name lookup is relatively simple: it only searches the explicitly named scope. It does not search enclosing or outer scopes. View the full article
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.