This is the mail archive of the gcc-patches@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: What's this?


>>>>> 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


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