You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chapters/90_theory.tex
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -42,3 +42,20 @@ \subsection{Friend functions vs ADL}
42
42
43
43
\subsection{Function objects vs ADL}
44
44
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.
0 commit comments