Article View: comp.std.c++
Article #3399Re: Problem with template overloading.
From: Johan Wikman
Date: Thu, 22 Feb 1996 15:51
Date: Thu, 22 Feb 1996 15:51
32 lines
1809 bytes
1809 bytes
In article <4gdc6v$cqv@engnews1.Eng.Sun.COM> clamage@Eng.sun.com (Steve Clamage) writes:
Yes. Only in special cases would you not have insurmountable ambiguities.
Just as type names must be unique in one scope, so must template names.
I'd like to be able to have a class and a template with the same name
in the same scope.
Usually when I write a template, I derive it from a class that is only
used as a base class of the template.
class BaseX { ... };
template<class T> class X : public BaseX { ... };
Consequently I must invent a descriptive name for the base class and
usually I end up with Base-something or Abstract-something. I'd like
to be able to write:
class X { ... };
template<class T> class X : public X { ... };
I don't think there would be ambiguities as an X without a template
argument is the "class" X and an X with a template argument is
obviously the "template" X.
[ 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:
<9602220718.AA11584@garlic.spices>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: wikman@research.nokia.com (Johan Wikman) Newsgroups: comp.std.c++ Subject: Re: Problem with template overloading. Date: 22 Feb 1996 15:51:08 GMT Organization: ? Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <9602220718.AA11584@garlic.spices> NNTP-Posting-Host: taumet.eng.sun.com Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Mailer: ELM [version 2.4 PL24alpha5] X-Lines: 25 Content-Length: 909 Originator: clamage@taumet