为什么连接时错的?
#pragma once
template<class t>
class AAA
{
public:
void f();
};
------------------------------
#include "AAA.h"
template<class t> void AAA<t>::f()
{
}
------------------------------------
#include "AAA.h"
void main()
{
AAA<int> a;
a.f();
}
---------------------------
error LNK2001: unresolved external symbol "public: void __thiscall AAA<int>::f(void)" (?f@?$AAA@H@@QAEXXZ)
Debug/AAA.exe : fatal error LNK1120: 1 unresolved externals