This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: template< typename T1> or template< class T1>


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]