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(whenTis a class) or the scope of enclosing class (whenTis 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
fooinmainare possible to resolve only because ADL checks the scope of classTand explicitly looks for friend functions there. Without ADL,foowould be invisible tomain.