4 ms·
What do templates have to do with storage, though? My primary attraction to C++ templates is that they let me write very expressive code that will compile down
by paulmooreparks 5y ago
What do templates have to do with storage, though? My primary attraction to C++ templates is that they let me write very expressive code that will compile down to a handful of instructions. Now, actually compiling complex C++ templates on a storage-constrained system can be a problem, since templates are compile-time beasts, not runtime. Once compiled, though, they have a Cheshire-cat existence.
Edit: Unless you're doing something rather silly with the templates, but again, that's not a template problem.
- saagarjha 5y agoThe general complaint with templates is they are instantiated and if you’re not careful can bloat the binary with multiple versions of a piece of code. But this is usually something pretty easy to solve: just don’t do something that would cause that to happen :P