Comment Re:What could possibly go wrong? (Score 1) 272
You can also specialize C code for architectures, you do not need C++ template metaprograms for this.
Of course, but you end up with code that is a lot more verbose and with more room for errors.
Anyway, a much more interesting particular example imho is using templates for lazy operator evaluation in matrix algebra. It lets you do automatically some loop combining that is absolutely visible speed-wise compared to a normal order-of-operations approach - the fun "oh, C++ can be faster than Fortran at matrix algebra??" surprise. Yeah, you can hand-code something like that in C every time you add some matrices, but