🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: alias name of parameterized class

#2935
From: Tero Pulkkinen
Date: Thu, 14 Dec 1995 20:17
30 lines
1639 bytes
In article <199512140426.NAA01763@k9.k2.t.u-tokyo.ac.jp> loba@k2.t.u-tokyo.ac.jp (Tomohira Tabata) writes:

   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.

Doesnt this work?

template <class T> typedef Vector<T> MyContainer;

Well, it didnt work with g++2.7.0. Though i dont know why wouldn't it work.
Reading the september working paper i didnt found anything, what would
forbid using it, and typedef is a simple-declaration and should be allowed
in template declaration, wouldnt it? [temp.2], [dcl.dcl.1], [dcl.spec.1]
So i guess its not yet implemented in g++ or i cant read the draft...

-- 
-- Tero Pulkkinen -- terop@kotka.cs.tut.fi --



---
[ 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: <xduag4vy2zz.fsf@kaarne.cs.tut.fi>
Path: arc1-ca.pugleaf.net!tcsi.tcs.com!agate!agate!matt
References: <199512140426.NAA01763@k9.k2.t.u-tokyo.ac.jp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!tcsi.tcs.com!agate!agate!matt
From: p150650@cs.tut.fi (Tero Pulkkinen)
Newsgroups: comp.std.c++
Subject: Re: alias name of parameterized class
Date: 14 Dec 1995 20:17:51 GMT
Organization: Tampere University of Technology, Finland
Approved: matt@Austern (Matt Austern)
Message-ID: <xduag4vy2zz.fsf@kaarne.cs.tut.fi>
References: <199512140426.NAA01763@k9.k2.t.u-tokyo.ac.jp>
NNTP-Posting-Host: austern.hip.berkeley.edu