Visibility of template specialization of C++ function

前端 未结 9 687
情书的邮戳
情书的邮戳 2021-01-01 11:21

Suppose I have fileA.h which declares a class classA with template function SomeFunc(). This function is implemented directly

9条回答
  •  走了就别回头了
    2021-01-01 12:04

    @[anthony-williams],

    are you sure you're not confusing extern template declarations with extern template instantiations? From what I see, extern template may only be used for explicit instantiation, not for specialization (which implies implicit instantiation). [temp.expl.spec] doesn't mention the extern keyword:

    explicit-specialization:
        template < > declaration

提交回复
热议问题