The answer was pretty simple:
N4296::3.4.1/8 [basic.lookup.unqual] :
For members of class X, the name used in the body member function , in the default argument, in the exception description, in the sliding or equal-initializer of the non-static data element (9.2) or in the definition of the class member outside the definition of X, after declaring the declarator-id31, is declared in one of the following ways:
[...]
(8.2) - must be a member of class X or be a member of base class X (10.2),
[...]
N4296::3.4.1/9 [basic.lookup.unqual] :
The search for the name for the name used in the friend function definition (11.3) defined inline in the class that provides friendships continues as described for the search in member function definitions .
What is it.
UPD:
Attachment is important here. Therefore, the friend function, defined outside the class definition, cannot directly use the static members of the class. For example, the following code causes a compile-time error:
Demo
user2953119
source share