K
Kobe
Is there any difference in:
template <class T>
vs.
template <typename T>
?
Thanks,
K
template <class T>
vs.
template <typename T>
?
Thanks,
K
Kobe said:Is there any difference in:
template <class T>
vs.
template <typename T>
?
Is there any difference in:
template <class T>
vs.
template <typename T>
?
Thanks,
K
Bob said:There is no difference except for the fact that using "class T" in the
above declaration might be somewhat misleading, since any type,
including non-class types such as int, can be used to instantiate the
template.
My advice is always use class keyword in angle brackets simply because
it is shorter to type.
Bob said:Who types any more? With the IDE I use, I hit "ty" and then
Ctrl-Space, then I can choose "typename" out of the list of C++
keywords which pops up.
Hi
Tsts... an editor. How old-fashioned.
I'm programming by drawing UML diagrams, from which the code gets
automatically generated. Very convenient, indeed ;-)
SCNR
Markus
Bob said:So does the UML-generated code use "typename" or "class"? <g>
Markus Moll said:Hi
Tsts... an editor. How old-fashioned.
I'm programming by drawing UML diagrams, from which the code gets
automatically generated. Very convenient, indeed ;-)
SCNR
Markus
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.