I have a function that is friend of a class. Therefore the function can access all class member. However, I am confused with the order of definition.
If the function comes before the class then how do could it even get the class member? if the class come before the function, then it cannot know the function.
How to solve such cross reference conflict?
So I have code
class BP_Interface
{
friend void CommonUtility::HandleToFrame(Handle&);
private:
Handle frame_in_model;
}
// followed by definition
namespace CommonUtility
{
void HandleToFrame(Handle& eR)
{
BP_Interface().frame_in_model = eR;
return;
}
}
visual studio IDE shows error, and says frame_in_model cannot be accessed.