This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: What's this?
- To: Robert L Krawitz <rlk at tiac dot net>
- Subject: Re: What's this?
- From: Jason Merrill <jason at cygnus dot com>
- Date: 20 Sep 1998 21:31:38 -0700
- Cc: oliva at dcc dot unicamp dot br, egcs-patches at cygnus dot com, law at cygnus dot com, egcs-bugs at cygnus dot com, smr at torrent dot com, jcallen at torrent dot com, rlk at rlk-ppp-1 dot torrent dot com
- References: <199809201534.LAA10532@rlk-ppp-1.torrent.com>
>>>>> Robert L Krawitz <rlk@tiac.net> writes:
> The problem is that this doesn't work with a lot of compilers:
> template<class T>
> class foo
> {
> friend void bar<>(foo<T>);
> };
> This, however, does work reliably, at least with the compilers I have
> at hand:
> template<class T>
> class foo
> {
> friend void bar<T>(foo<T>);
> };
That's bizarre; I can't imagine why compilers would support explicit
specification of template args to function templates but not allow the
null arg list.
>> From a standpoint of clarity and back compatibility, I believe that it
> would be preferable to emphasize that the second form is equally legal
> (it is, no?) and more compatible with older compilers.
It is equally legal, but it's more hassle, and could suppress the use of
specialized definitions; what if you defined a version of bar for pointers?
Jason