I have found that friend function can be defined inside class declaration. I am a little bit confused about what does it mean due to a class declaration does not provide it's body, in general it just class A;
.
Friend functions can be defined (given a function body) inside class declarations. These functions are inline functions, and like member inline functions they behave as though they were defined immediately after all class members have been seen but before the class scope is closed (the end of the class declaration). Friend functions that are defined inside class declarations are in the scope of the enclosing class.
Source: https://learn.microsoft.com/en-us/cpp/cpp/friend-cpp?view=vs-2019