🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: alias name of parameterized class

#2936
From: rjl
Date: Thu, 14 Dec 1995 20:59
29 lines
1716 bytes
In article <199512140426.NAA01763@k9.k2.t.u-tokyo.ac.jp> you write:
: 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.

How about this -

template <class X> class Y : public Vector<X> {};

A template Y<T> is effectively a synonym for a Vector<X>.   A good
compile should have no difficulty with this.

Regards,
	Rohan


-- 
----------------------------------------------------------------------------
rjl@iassf.easams.com.au	| All quotes can be attributed to my automated quote
Rohan Lenard            | writing tool.  Yours for just $19.95; and if you
+61-2-367-4555          | call now you'll get a free set of steak knives ...

[ 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: <199512141952.AA12197@hercules.iassf.easams.com.au>
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
From: rjl@iassf.easams.com.au
Newsgroups: comp.std.c++
Subject: Re: alias name of parameterized class
Date: 14 Dec 1995 20:59:18 GMT
Organization: EASAMS (Australia) Pty Ltd
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <199512141952.AA12197@hercules.iassf.easams.com.au>
NNTP-Posting-Host: taumet.eng.sun.com
Content-Type: text
In-Reply-To: <199512140426.NAA01763@k9.k2.t.u-tokyo.ac.jp>
Cc: std-c++@ncar.ucar.edu
Content-Length: 926
X-Lines: 25
Originator: clamage@taumet