From -541866506264913392
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,b39fa6eddecc0203,start
X-Google-Attributes: gidf78e5,public
From: sj@aracnet.com (Scott Johnson)
Subject: typedefs and templates
Date: 1996/08/15
Message-ID: <4v05f7$on6@shelob.aracnet.com>#1/1
X-Deja-AN: 174437703
x-original-date: 15 Aug 1996 14:39:51 -0700
recieved: by shelob.aracnet.com (8.6.12)  id OAA25319; Thu, 15 Aug 1996 14:39:55 -0700
organization: aracnet.com -- Portland's loudest electrons (info@aracnet.com)
x-auth: PGPMoose V1.1 PGP comp.std.c++
newsgroups: comp.std.c++
originator: austern@isolde.mti.sgi.com


I know it is legal to do the following:

template <class T> class Foo;
typedef Foo< int > Bar;

In other words, using typedef to create an instantiation of a template,
and give it a name.

But is it legal (it don't work under GCC 2.7.2) to rename a template using
typedef?  And if it isn't, has this feature ever been considered?B

template <class T> class Foo;
template <class T> typedef Foo<T> Bar<T>;
typedef Bar< int >;	// instantiate Bar< int >, which is really Foo< int >

Or even, God forbid:

template <class T> typedef Pointer< T> T*;

(I say "good forbid" because templates instantiations are usually classes
r functions, and a plain vanilla pointer ain't neither.......)


Scott "Geez, I'm full of annoying language extension proposals, ain't I"
Johnson


-- 
/--------------------------------------------------------------------------\
|Scott Johnson -- Professional (sometimes) SW Engineer and all-purpose Geek|
|I don't speak for nobody but myself, which everyone else is thankful for  |
\--------------------------------------------------------------------------/
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]



