What is the syntax for declaring a static member function as a friend
of the class in which it resides.
class MyClass
{
private:
static void Callback(void* thisptr); //Declare static member
friend static void Callback(void* thisptr); //Define as friend of itself
}
Can I fold it into this one-liner?
class MyClass
{
private:
friend static void Callback(void* thisptr); //Declare AND Define as friend
}
Is there another way to fold it all into a single line?
Answer
Please don't downvote, this stems from my lack of knowledge about C++ static member functions. The answer is that they don't need to be friend, they already can access private members. So my question was somewhat invalid.