+ 8
Is there any difference of speed when we define an object of a template class by mentioning data type and the same by not ....?
2 Réponses
+ 4
Generally you use templates to do the work you can do at compile time, so compile time increase.
You may do this to optimize your code so it should run faster at runtime.
This is just a general sense though it depends on what you exactly want to do.
0
they don't affect the run time since the objects are creating at the time of compile:
https://stackoverflow.com/questions/2442358/do-c-templates-make-programs-slow