🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3477

Re: Problem with template overloading

#3477
From: Steve Clamage
Date: Sun, 18 Feb 1996 06:05
33 lines
1552 bytes
"brian (b.c.) white" <bcwhite@bnr.ca> writes:

>Is it allowed to overload template names based on their parameters
>in the same way that functions can be overloaded?

>I tried to create two versions of the same class name as such:

>template <class C>
>class A {
>	[...]
>};

>template <class C1, class C2>
>class A {
>	[...]
>};

No, that is not allowed. You cannot have more than one template
with the same name in the same scope.

The closest you could come would be to use a default template
parameter or partial specialization. Not all compilers support
those features yet.

--
Steve Clamage, stephen.clamage@eng.sun.com

[ To submit articles: Try just posting with your newsreader.  If that fails,
		      use mailto:std-c++@ncar.ucar.edu
  FAQ:    http://reality.sgi.com/employees/austern_mti/std-c++/faq.html
  Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]
Technical Details
Message-ID: <4g62e0$kub@engnews1.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
References: <4g40t8$kpq@bcarh8ab.bnr.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
From: clamage@Eng.sun.com (Steve Clamage)
Newsgroups: comp.std.c++
Subject: Re: Problem with template overloading
Date: 18 Feb 1996 06:05:16 GMT
Organization: Sun Microsystems Inc., Mountain View, CA
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <4g62e0$kub@engnews1.Eng.Sun.COM>
References: <4g40t8$kpq@bcarh8ab.bnr.ca>
NNTP-Posting-Host: taumet.eng.sun.com
Content-Type: text
X-Nntp-Posting-Host: taumet.eng.sun.com
X-Newsreader: NN version 6.5.0 #21 (NOV)
Content-Length: 626
Originator: clamage@taumet