Skip to content

Commit d84900c

Browse files
committed
P1965R0 Blanket Wording for Specifying "Hidden Friends"
Also fixes NB DE 165 and LWG3239
1 parent 81f1d68 commit d84900c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

source/lib-intro.tex

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,6 +3121,29 @@
31213121
or add additional signatures for a member function name.
31223122
\end{note}
31233123

3124+
\rSec3[hidden.friends]{Friend functions}
3125+
3126+
\pnum
3127+
Whenever this document specifies
3128+
a friend declaration of a function or function template
3129+
within a class or class template definition,
3130+
that declaration shall be
3131+
the only declaration of that function or function template
3132+
provided by an implementation.
3133+
\begin{note}
3134+
In particular,
3135+
an implementation is not allowed to provide
3136+
an additional declaration of that function or function template
3137+
at namespace scope.
3138+
\end{note}
3139+
\begin{note}
3140+
Such a friend function or function template declaration
3141+
is known as a hidden friend,
3142+
as it is visible neither
3143+
to ordinary unqualified lookup\iref{basic.lookup.unqual} nor
3144+
to qualified lookup\iref{basic.lookup.qual}.
3145+
\end{note}
3146+
31243147
\rSec3[constexpr.functions]{Constexpr functions and constructors}
31253148

31263149
\pnum

0 commit comments

Comments
 (0)