草庐IT

TNCPConnection

全部标签

c++ - 如何正确地进行显式模板实例化?

我正在使用模板来实现CRTP模式。使用下面的代码,我得到链接器错误(对于基类CPConnectionBase中定义的所有方法),如下所示:errorLNK2001:unresolvedexternalsymbol"public:void__thiscallCPConnectionBase::start(void)"(?start@?$CPConnectionBase@VTNCPConnection@@@@QAEXXZ)我想这里的解决方案是显式模板实例化。事实上,我可以在添加时构建我的代码#include"TNCPConnection.h"templateclassCPConnectio