wbest
July 21st, 2009, 09:37 PM
Riddle me this, my brethren!
g++ gives me the error
error: a class-key must be used when declaring a friend
So I go to the line it refers to
class __XAuto;
typedef XSingleton<TYPE> __singleton;
friend typename __singleton::__XAuto;
I've read it needs to have "class" jammed in there. So I do that.
friend class typename __singleton::__XAuto;
Then I get this from g++
error: expected identifier before ‘typename’
error: multiple types in one declaration
error: friend declaration does not name a class or function
Okay, so maybe I put it in the wrong place.
class friend typename __singleton::__XAuto;
error: expected identifier before ‘friend’
error: multiple types in one declaration
error: friend declaration does not name a class or function
Huh...the same error. And apparently the friend declaration does not name a class.
But I've already been told I need a class key with a friend.
What do I do? WHAT DO I DO!?
g++ gives me the error
error: a class-key must be used when declaring a friend
So I go to the line it refers to
class __XAuto;
typedef XSingleton<TYPE> __singleton;
friend typename __singleton::__XAuto;
I've read it needs to have "class" jammed in there. So I do that.
friend class typename __singleton::__XAuto;
Then I get this from g++
error: expected identifier before ‘typename’
error: multiple types in one declaration
error: friend declaration does not name a class or function
Okay, so maybe I put it in the wrong place.
class friend typename __singleton::__XAuto;
error: expected identifier before ‘friend’
error: multiple types in one declaration
error: friend declaration does not name a class or function
Huh...the same error. And apparently the friend declaration does not name a class.
But I've already been told I need a class key with a friend.
What do I do? WHAT DO I DO!?