I agree with that, but I was thinking more along the lines of... some complex recursive template specialisation that takes ages to compile, but when it eventually does, it coughs up barely a handful of lines of assembly that map to the metaprogramming recursion, anyway.
I was also certain that templates are only instantiated for the types you specify to them, unlike Java generics, so one could have a templated header but no instantiations whatsoever...
... But then, there's also the rub. Every time you do instantiate the template, even conditionally, you get more code. It's both the best and worst part of C++ templates.
27
u/delta_p_delta_x Jul 13 '22
I was under the impression that heavy template metaprogramming only causes skyrocketing compile times, not bloated binaries...