C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Template typedefs

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards
View previous topic :: View next topic  
Author Message
Samee Zahur
Guest





PostPosted: Sun Apr 17, 2005 8:09 pm    Post subject: Template typedefs Reply with 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>;

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





PostPosted: Mon Apr 18, 2005 10:49 pm    Post subject: Re: Template typedefs Reply with quote



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





PostPosted: Tue Apr 19, 2005 1:58 am    Post subject: Re: Template typedefs Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.