On Tue, 22 Apr 2003 10:33:05 -0400, Daniel Berlin
<dberlin at dberlin dot org> said:
To answer whether you need the return type, let's add two
specializations here and make it worse:
template <> long foo (int a)
{
return 9;
}
template <> int foo (int a)
{
return 10;
}
Yeah, but that's illegal, isn't it? You can't have two functions that
differ only in return type: otherwise, how would the compiler know
which one to use in a call to foo?
I tried it out in GCC; the above doesn't compile (I guess templates
with 0 parameters aren't legal),