When does template instantiation bloat matter in practice?

前端 未结 5 852
忘了有多久
忘了有多久 2021-01-02 00:56

It seems that in C++ and D, languages which are statically compiled and in which template metaprogramming is a popular technique, there is a decent amount of concern about t

5条回答
  •  梦谈多话
    2021-01-02 01:49

    Template instantion bloat IS a matter in practice, because it can increases ( a lot!!! ) compile and link time.

    I personnaly thinks that c++ #1 problem is compil time, and it's mainly due to template.

    I worked on a project with about 50 libs. We had our own rtti system using templates. I had to rewrite because of the template bloat

    Here is some numbers:

    • libs went from 640 mbytes to 420 mbytes
    • temps went from 4.3 gbytes to 2.9 gbytes
    • full rebuild went from 19:30 to 13:10

提交回复
热议问题