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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux