🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Alexandre Oliva Fri, 08 Dec 1995 04:08
have template typedefs been considered?
#2894
Author: Alexandre Oliva
Date: Fri, 08 Dec 1995 04:08
37 lines
1400 bytes

Have things such as:


template <class T1, class T2> foo;

class bar;

template <class T> typedef foo<T, bar> foobar;

foobar<int> myfoobar; // this should mean foo<int, bar> myfoobar;


... ever been considered in the C++ standardization process?

Sometimes it would be very convenient to define template aliases, to
avoid having to explicitly select commonly used parameters for a
template every time they are used inside a program.

The workaround I use is:

template <class T> class foobar : public foo<T, bar> {};

but the compiler warns me if foo<T, bar> has non-default constructors,
and, besides that, foobar and foo<T, bar> are not the SAME type this
way.
-- 
Alexandre Oliva
oliva@dcc.unicamp.br
Universidade Estadual de Campinas, S~ao Paulo, Brasil


---
[ 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. ]
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