Article View: comp.std.c++
Article #2925Re: alias name of parameterized class
From: Tomohira Tabata
Date: Thu, 14 Dec 1995 04:52
Date: Thu, 14 Dec 1995 04:52
35 lines
1914 bytes
1914 bytes
>>>>> On 14 Dec 1995 02:55:53 +0900, clamage@Eng.Sun.Com (Steve Clamage) said:
>> In article WAA24242@k4.k2.t.u-tokyo.ac.jp, TABATA Tomohira <loba@k2.t.u-tokyo.ac.jp> writes:
>> Is the following use of typedef allowed to make alias names of
>> a parameterized class?
>>
>> template <class T> ParameterizedClass { /* ... */ };
>> typedef ParameterizedClass PC;
>> No, because "ParameterizedClass" is not the name of a type. (A template
>> is not a type.)
>> You can write, for example.
>> typedef ParameterizedClass<int> PCint;
>> because ParameterizedClass<int> is the name of a type.
I wonder we have no method of giving a template a different name.
Typedef provides a new concept to a type, for example.
typedef int size_t;
In the same manner I'd like to give a alias to a template. I know it
is possible using #define.
#define MyContainer Vector
We need a method independent of the preprocessor for the purpose.
------
Tomohira Tabata loba@k2.t.u-tokyo.ac.jp
Department of Mathematical Engineering and Information Physics,
Faculty of Engineering, University of Tokyo, Japan
TEL: +81-3-3812-2111 ext. 6902 FAX: +81-3-5800-6969
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<199512140426.NAA01763@k9.k2.t.u-tokyo.ac.jp>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: loba@k2.t.u-tokyo.ac.jp (Tomohira Tabata) Newsgroups: comp.std.c++ Subject: Re: alias name of parameterized class Date: 14 Dec 1995 04:52:14 GMT Organization: ? Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <199512140426.NAA01763@k9.k2.t.u-tokyo.ac.jp> NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text In-Reply-To: clamage@Eng.Sun.Com's message of 14 Dec 1995 02:55:53 +0900 Content-Length: 1156 Originator: clamage@taumet