Why full specialization of template function is not picked up from the .cpp file without declaration?

后端 未结 3 1199
盖世英雄少女心
盖世英雄少女心 2021-01-23 04:42

Following code generate no compilation/linker error/warning:

// A.h
#include
struct A
{
  template
  static void foo (T t)
  {
         


        
3条回答
  •  忘掉有多难
    2021-01-23 05:34

    main.cpp cannot see the code inside other.cpp. Template specializations are of file scope.

提交回复
热议问题