DWP guiding decls with egcs-1.0.1
Alexandre Oliva
oliva@dcc.unicamp.br
Sat Jan 10 19:16:00 GMT 1998
Miljenko Cvjetko writes:
> What are these guiding decls and how am I supposed to
> declare for example operator== or operator<< ???
Guiding declarations are deprecated template declarations that look
like non-template ones, just like the one you're trying to do. This
has been supported in previous versions of gcc, but it no longer is,
as it is non-standard and ambiguous.
> What does " add <> after the function name " mean???
It means that, in order to tell the compiler that the friend
declaration refers to a specialization of a template, you must add
angle brackets after the function name in that declaration.
> Further, playing with this example I came up with internal compiler
> error which might interest You.
This may be fixed in the next snapshot. The error occurs because you
have referred to a template that had not been declared yet. A valid
declaration of the function template must be provided in namespace
scope (not in the class scope) before the friend declaration:
template <class T> class X;
template <class T> bool operator==(const X<T>&, const X<T>&);
> template <class T>
> class X
> {
//...
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil
More information about the Gcc-bugs
mailing list