|
|
|
|
|
by xyzzyz
5789 days ago
|
|
What kind of speed increase are you talking about? Your comment's logic seems to suggest that, for instance, C (a language without templates) is inherently slower than C++, which is not the case. Can you back your statements up with evidence? |
|
Because templates are basically automated code copy-paste, the compiler can more easily inline at compile-time. Unfortunately, it also translates to lots more compiled code, which means slower compile times and fatter binaries. Still, writing something like the STL library in C with the same performance characteristics would be much more difficult, if not impossible.
I'm not a C++ expert, but that's my understanding of things, at least.