What is the difference between defining friend function inside the class or declaring inside and define outside of the class. Also why it is possible to place definition ins
A function can be defined in a friend declaration of a class if and only if the class is a non-local class , the function name is unqualified, and the function has namespace scope. Such a function is implicitly inline. A friend function defined in a class is in the (lexical) scope of the class in which it is defined. A friend function defined outside the class is not .
C++11, [class.friend], ¶6-7