I found about it on wikipedia :
structural scope of T (which can be used to locate friend functions)
Could someone please explain what is it? Google was not of much help.
I found about it on wikipedia :
structural scope of T (which can be used to locate friend functions)
Could someone please explain what is it? Google was not of much help.
Copyright © 2021 Jogjafile Inc.
Since it mentions friend lookup, "structural scope" in this case appears to refer to scope of class
T
(whenT
is a class) or the scope of enclosing class (whenT
is a member type declared inside a class). The wording of that entire paragraph sounds rather strange, since C++ language does not formally refer to class types as "structure types" and does not formally define "structural scope". On top of that it seems to refer to class scope as "namespace", which is incorrect.By mentioning friends, it apparently implies situations like
or
In these cases calls to
foo
inmain
are possible to resolve only because ADL checks the scope of classT
and explicitly looks for friend functions there. Without ADL,foo
would be invisible tomain
.