2 ms·
My point is not out of date. You can use techniques like type erasure to reduce bloat, and compilers and linkers do combine identical code sequences in many ca
by quotemstr 9y ago
My point is not out of date.
You can use techniques like type erasure to reduce bloat, and compilers and linkers do combine identical code sequences in many cases, but the point remains that templates work by replicating code for each instantiation. If you blindly trust the toolchain to clean up for you (as your first link suggests), you're going to run into problems. Size problems are insidious because they don't show up until they're hard to fix.
I'm not suggesting that you never use templates, but I am insisting that you understand what they do instead of trusting the compiler to sweep everything under the rug.