Why won't “extern template” work with shared_ptr?

流过昼夜 提交于 2019-12-03 15:24:19

The standard says in §14.7.2/10:

Except for inline functions and class template specializations, explicit instantiation declarations have the effect of suppressing the implicit instantiation of the entity to which they refer.

I just checked in VS2013 and the implementation of std::shared_ptr<> there has an inline constructor. This is probably the reason why your extern template is ignored.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!