Visibility of template specialization of C++ function

前端 未结 9 827
情书的邮戳
情书的邮戳 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 11:56

    Unless the specialized template function is also listed in the header file, the other application will have no knowledge of the specialized version. The solution is the add SomeFunc() to the header as well.

提交回复
热议问题