Topic: Can A<S> and A<S, T> coexist ?


Author: xjzhu@math.uwaterloo.ca (Xiaojun Zhu)
Date: Tue, 24 Nov 1992 04:06:45 GMT
Raw View
Q: Can A<S> and A<S, T> coexist?

I.e., is the following declaration valid?

template<class S> class A{};
template<class S, class T> class A{};

AT&T C++ V3.0 fails on comipling the above code.

As I see it, since the two A's are accepting different number of arguments,
there is no reason why such thing should not be allowed.

Any comments?



--------------------------------------------------------------
   A template version of my signature class is under repair.
Symptom: It dies without a warning if I use certain class
         as an argument.

                                       xjzhu@math.uwaterloo.ca
--------------------------------------------------------------




Author: vladimir@intrepid.com (Vladimir Vukicevic)
Date: Sat, 28 Nov 1992 21:07:54 GMT
Raw View
In article <By7Cr9.5K4@math.uwaterloo.ca> xjzhu@math.uwaterloo.ca (Xiaojun Zhu) writes:
>Q: Can A<S> and A<S, T> coexist?
>
>I.e., is the following declaration valid?
>
>template<class S> class A{};
>template<class S, class T> class A{};
>
>AT&T C++ V3.0 fails on comipling the above code.
>
>As I see it, since the two A's are accepting different number of arguments,
>there is no reason why such thing should not be allowed.
>
>Any comments?
>

You're trying to overload a class name; can't do that.
(According to this C++ Ref Card)

 - Vladimir

--
#----           Vladimir Vukicevic             #include <disclaimer.h>
#---------      vladimir@intrepid.com          #include <noflame.h>
#--------       Prodigy: TGTM25C    (Hardly ever checked)