This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Declaration of static friend function
- To: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Subject: Declaration of static friend function
- From: "Mevorach, Assaf" <assaf dot mevorach at intel dot com>
- Date: Sun, 14 May 2000 08:03:03 -0700
Hello
I am working with gcc version 2.91 and I am facing the following problem,
I wonder if any of you can help me.
It seems that it is not possible to declare in a class a static friend
function from another class
what I try to compile is this :
class A_maker {
.
.
.
public:
A_maker (MachineType mtype ) {(make(mtype));}
static A * make (MachineType mtype = 1);
.
.
.
};
class A{
.
.
.
protected:
A(void) {};
friend static A* A_maker::make(MachineType mtype); <-- this line fails
.
.
.
};
and the error I got:
"storage class specifiers invalid in friend function declarations"
Is it true that this version doesn't support static friends ?
does anyone knows if this feature is supported in the current version
(2.95.2) ?
Thank you
Assaf Mevorach