How to use extern template

前端 未结 1 455
-上瘾入骨i
-上瘾入骨i 2021-01-03 20:16

I\'ve been looking through the N3291 working draft of C++0x. And I was curious about extern template. Section 14.7.3 states:

Except for inline functio

相关标签:
1条回答
  • 2021-01-03 20:33

    It says

    Except for ...class template specializations

    So it does not apply to std::vector<int>, but to its members (members that aren't inline member functions and presumably that aren't nested classes. Unfortunately, there isn't a one term that catches both of "class template specialization and specializations of member classes of class templates". So there are some places that use only the former but mean to also include the latter). So std::vector<int> and its nested classes (like std::vector<int>::iterator, if it is defined as a nested class) will still be implicitly instantiated if needed.

    0 讨论(0)
提交回复
热议问题