This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: friends and inner classes


Nyny  <Nyny.sxthree@penfeld.tls.mms.fr> writes:

> I've already posted that a couple of times but got no answer:

> g++ -c -o foo.o foo.cc
> foo.cc:10: member `foo::func(foo::bar *)' declared as friend before type
> `foo' defined

The code seems correct to me; gcc/egcs should accept it.

Until a patch that fixes this problem is provided, you may work around 
this problem by moving the definition of foo::bar outside foo body:

class foo {
  class bar;
//...
};
class foo::bar {
//...
};

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil


--AAA18016.897017864/grande.dcc.unicamp.br--





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]