Separate compilation and template explicit instantiation

后端 未结 2 549
遥遥无期
遥遥无期 2021-01-15 05:03

Summary
This question is about achieving separate compilation of a single template class instantiation in a several different translation units.

<
2条回答
  •  终归单人心
    2021-01-15 05:49

    Separate compilation of templates is tricky but allowed. What you cannot do is to explicitly instantiate the type in multiple translation units, in the same way that you cannot define the same function in two translation units.

提交回复
热议问题