Is Template Metaprogramming faster than the equivalent C code?

前端 未结 8 2449
旧时难觅i
旧时难觅i 2021-01-02 02:07

Is Template Metaprogramming faster than the equivalent C code ? ( I\'m talking about the runtime performance) :)

8条回答
  •  时光取名叫无心
    2021-01-02 02:31

    Template Metaprogramming (TMP) is 'run' at compile time, so it's not really comparing apples to apples when comparing it to normal C/C++ code.

    But, if you have something evaluated by TMP, then there's no runtime cost at all.

提交回复
热议问题