🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by J. Karl Armstrong Sat, 17 Feb 1996 00:11
template typedef
#2972
Author: J. Karl Armstrong
Date: Sat, 17 Feb 1996 00:11
18 lines
1379 bytes
Is there any reason why template typedefs are not allowed? Something like:

template <class T>
typedef T *GeneralPointer;

GeneralPointer<int> iptr;

Trivial example, I know, but there are reasons I would like this.

-- 
J. Karl Armstrong                            Computing Devices Int.
jonathan.k.armstrong@cdev.com                6041 S. Syracuse Way, Ste 300
(303) 779-7702                               Greenwood Villiage, CO, 80111
(303) 779-7704 (fax)
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
Re: template typedef
#3443
Author: Scott Howlett
Date: Mon, 19 Feb 1996 02:29
29 lines
1531 bytes
jonathan.k.armstrong@cdev.com (J. Karl Armstrong) wrote:

> Is there any reason why template typedefs are not allowed? Something like:
> 
> template <class T>
> typedef T *GeneralPointer;
> 
> GeneralPointer<int> iptr;
> 
> Trivial example, I know, but there are reasons I would like this.

I would find this convenient as well, but it's easy to get this
functionality in a slightly different way (and perhaps this is the reason
that it isn't supported directly?):

template <class T> struct foo {
    typedef T * GeneralPointer;
};

foo<T>::GeneralPointer iptr;

-- 
Scott Howlett, howlett@netcom.com
"Probably the earliest fly swatters were nothing more than some sort of 
striking surface attached to the end of a long stick."
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  Moderation policy:
  http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads