Topic: templates & friendship easy question


Author: chris@alofi.etca.fr (Christian Millour)
Date: 10 Mar 1995 15:57:52 GMT
Raw View
hello world,

cfront 3.0.1 chokes on this one (deemed kosher by g++)

template <class Foo> class Bar {
friend class Foo;
};

Which compiler is right ? Is there a workaround ?

BTW, the question is *not* academic. I *do* have a use for this
construct (email me for details).

TIA,

--chris@etca.fr
Le monde entier est un cactus, il est impossible de s'asseoir (J. Dutronc)




Author: rael@world.std.com (Bill Lear)
Date: Fri, 10 Mar 1995 19:05:30 GMT
Raw View
In article <3jpsu0$s3k@etca.etca.fr>,
Christian Millour <chris@alofi.etca.fr> wrote:
>hello world,
>
>cfront 3.0.1 chokes on this one (deemed kosher by g++)
>
>template <class Foo> class Bar {
>friend class Foo;
>};
>
>Which compiler is right ? Is there a workaround ?
>
[...]

I can't give you a definitive answer, but my Solaris CC (latest, non-cfront)
handles this just fine (as does my g++ (2.6.3)).

Bill Lear (rael@world.std.com)