Skip to content

Commit 6656a52

Browse files
Merge overleaf-2022-09-27-1728 into main
2 parents 0e94f23 + 2c1641b commit 6656a52

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

chapters/90_theory.tex

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,20 @@ \subsection{Friend functions vs ADL}
4242

4343
\subsection{Function objects vs ADL}
4444

45+
The second notable interaction occurs with non-function symbols. In the context of this section, the important ones are function objects (and lambdas).
46+
47+
Argument-dependent lookup will not consider non-function symbols. This means that a function object or a lambda must be either visible to an unqualified lookup or need to be fully qualified.
48+
49+
\begin{box-note}
50+
\footnotesize Example demonstrating a lambda stored in an inline variable that can only be invoked through a qualified call.
51+
\tcblower
52+
\cppfile{code_examples/theory/adl_nonfunc_code.h}
53+
\end{box-note}
54+
55+
Finally, discovering a non-function symbol during the unqualified lookup phase will prevent ADL completely.
56+
57+
\begin{box-note}
58+
\footnotesize Example demonstrating a non-function object preventing ADL, making a friend function impossible to invoke.
59+
\tcblower
60+
\cppfile{code_examples/theory/adl_shutdown_code.h}
61+
\end{box-note}

0 commit comments

Comments
 (0)