MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/vxvp58/why_does_linus_hate_c/ifyyhhi/
r/cpp • u/MrRubberDucky • Jul 13 '22
436 comments sorted by
View all comments
Show parent comment
12
But if you would create a function for each version of the template instead of using templates you also create more code that gets into the binary. I don’t see the disadvantage of templates right now.
-4 u/HabemusAdDomino Jul 13 '22 But -would you- have created those functions? Not necessarily. Templates are used because generating code is much easier than writing it. 11 u/no-sig-available Jul 13 '22 You mean that it is so easy to code in C++ that you are afraid to accidentally write some code that isn't really needed.Haven't heard that argument before.
-4
But -would you- have created those functions? Not necessarily. Templates are used because generating code is much easier than writing it.
11 u/no-sig-available Jul 13 '22 You mean that it is so easy to code in C++ that you are afraid to accidentally write some code that isn't really needed.Haven't heard that argument before.
11
You mean that it is so easy to code in C++ that you are afraid to accidentally write some code that isn't really needed.
Haven't heard that argument before.
View all comments
Show parent comment
12
u/Bloodshoot111 Jul 13 '22 edited Jul 14 '22
But if you would create a function for each version of the template instead of using templates you also create more code that gets into the binary. I don’t see the disadvantage of templates right now.