Skip to content

Commit

Permalink
Fixes to ADL slide concerning the order of searches
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Ponce authored and Sebastien Ponce committed Oct 16, 2023
1 parent 0bf049c commit f0cd593
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions talk/objectorientation/adl.tex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
\begin{itemize}
\item here for \cppinline{std} and \cppinline{operator<<}
\item name is looked for in a sequence of scopes until found
\item remaining scopes are not examined
\begin{itemize}
\item remaining scopes are not examined
\end{itemize}
\item in parallel Argument Dependent Loopkup (ADL) may happen
\end{itemize}
\end{itemize}
\end{block}
Expand All @@ -32,11 +35,14 @@
\item file (only for global level usage)
\item current namespace/block, enclosing namespaces/blocks, etc...
\item current class if any, base classes if any, etc...
\item for a call expression (e.g.\ \cppinline{f(a, b)} or \cppinline{a + b}), Argument Dependent Lookup (ADL)
\end{itemize}
\end{block}
\begin{exampleblock}{Argument Dependent Lookup (simplified)}
To find a function name (including operators), the compiler also examines the arguments. For each argument, it searches:
Only for call expression
\begin{itemize}
\item e.g.\ \cppinline{f(a, b)} or \cppinline{a + b}
\end{itemize}
The compiler also examines arguments one by one and searches:
\begin{itemize}
\item class, if any
\item direct and indirect base classes, if any
Expand Down

0 comments on commit f0cd593

Please sign in to comment.