Explicit template instantiation - when is it used?

前端 未结 4 1260
一整个雨季
一整个雨季 2020-11-22 11:14

After few weeks break, I\'m trying to expand and extend my knowlege of templates with the book Templates – The Complete Guide by David Vandevoorde and Nicolai

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 12:11

    It depends on the compiler model - apparently there is the Borland model and the CFront model. And then it depends also on your intention - if your are writing a library, you might (as alluded above) explicitly instantiate the specializations you want.

    The GNU c++ page discusses the models here https://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/Template-Instantiation.html.

提交回复
热议问题