[Cs3] typename vs. class for type parameters

Mikhail Nesterenko mikhail at cs.kent.edu
Mon Feb 24 22:14:56 EST 2014


CS3 students,

Both

	template <class T>
	mytemplate ...

and 
        template <typename T>
	mytemplate ...

are legal and mean the same thing. The reason the two options exist is
historical.  "typename" is somewhat more modern, so I now recommend
using "typename". I updated the examples and slides.

Thanks,
-- 
Mikhail


More information about the cs3 mailing list