Article View: comp.std.c++
Article #2894have template typedefs been considered?
From: Alexandre Oliva
Date: Fri, 08 Dec 1995 04:08
Date: Fri, 08 Dec 1995 04:08
37 lines
1400 bytes
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. ]
Technical Details
Message-ID:
<orivjsjzmx.fsf@negro.dcc.unicamp.br>Path:
arc1-ca.pugleaf.net!usenet.kornet.nm.kr!agate!agate!MattShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!usenet.kornet.nm.kr!agate!agate!Matt From: oliva@negro.dcc.unicamp.br (Alexandre Oliva) Newsgroups: comp.std.c++ Subject: have template typedefs been considered? Date: 08 Dec 1995 04:08:34 GMT Organization: DCC - UNICAMP - Campinas, SP, Brazil Approved: Matt@Austern Message-ID: <orivjsjzmx.fsf@negro.dcc.unicamp.br> NNTP-Posting-Host: austern.hip.berkeley.edu