This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: template< typename T1> or template< class T1>
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: jeff dot holle at verizon dot net, gcc-help at gcc dot gnu dot org
- Date: Fri, 14 May 2004 15:39:48 -0500
- Subject: Re: template< typename T1> or template< class T1>
- References: <c83ag1$ou4$1@sea.gmane.org>
Hi Jeff,
>Which is the preferred syntax?
I prefer "typename T1", but Stroustrup prefers "class T1" (less typing).
>Are these equivalent?
I believe so.
>Can anything else besides "typename" or "class" be used?
Sort of. You could have...
template <class T, int Value>
...but that int Value doesn't have the same broad range of types that class
(or typename) have.
HTH,
--Eljay