 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Samee Zahur Guest
|
Posted: Sun Apr 17, 2005 8:09 pm Post subject: Template typedefs |
|
|
Hi everyone,
I was just wondering if the standard allows this sort of templated
typedefs are allowed in the standard.
template <class X,class Y> class tclass {/*...*/};
template <class X> typedef tclass<X,int> newclass<x>;
Where in the second line I'm basically aiming to do more or less the
same thing this would:
template <class X> class newclass:public tclass<X,int> {};
It's just that the typedef kind of statements make the sense of the job
clearer to the reader.
Samee
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
Bronek Kozicki Guest
|
Posted: Mon Apr 18, 2005 10:49 pm Post subject: Re: Template typedefs |
|
|
Samee Zahur <samee.zahur (AT) gmail (DOT) com> wrote:
| Quote: | Hi everyone,
I was just wondering if the standard allows this sort of templated
typedefs are allowed in the standard.
template <class X,class Y> class tclass {/*...*/};
template <class X> typedef tclass<X,int> newclass<x>;
|
such thing is likely to appear in C++ 0x, but syntax would be slightly
different. For details see
http://www.open-std.org/jtc1/sc22/WG21/docs/papers/2003/n1489.pdf
B.
(moderator : feel free to drop this message if someone else already
replied)
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
Ben Hutchings Guest
|
Posted: Tue Apr 19, 2005 1:58 am Post subject: Re: Template typedefs |
|
|
Samee Zahur wrote:
| Quote: | Hi everyone,
I was just wondering if the standard allows this sort of templated
typedefs are allowed in the standard.
snip |
No, there's currently no such thing as a typedef template. However
there has been a proposal for a more general feature of "template
aliases" to be included in the next standard:
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1449.pdf>.
--
Ben Hutchings
For every complex problem
there is a solution that is simple, neat, and wrong.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|