Topic: have template typedefs been considered?


Author: oliva@negro.dcc.unicamp.br (Alexandre Oliva)
Date: 1995/12/08
Raw View

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