If the operator function is a friend of the 'Shinigami' class, why doesn't it recognize any of it's private members? I need it to be in this file because I'm doing a bit of association with the 'Quincy' class.
I thought it was the namespace, but I included that.
Thanks MiiNiPaa; i was wrong, the code compiled and worked as expected. But, would you mind explaining how this works? Like why do do I have to make a forward declaration for the namespace and (prototype?) for the operator overload. Also, what's the deal with this (::operator<<) ?
:: is a scope resolution operator. ::operator<< tells, that operator<< is in global namespace. For some reason compiler doesn't accept this as declaration and gives an error operator<< isn't declared. So we need forward declaration of operator in global namespace. If we do so, compiler will tell, that class K::Shinigami wasn't declared, so we need to forward declare class Shinigami inside K namespace.
cire's method will work too. I had doubts if operator will work without usingnamespace K; or K:: specification for operator, but other sources told me that everything will be fine.