New to C++ and have been trying to get class templates to work. Ive been getting the following errors in Visual Studio 2015:
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "public: __thiscall TemplateTest<int>::TemplateTest<int>(int,int)" (??0?$TemplateTest@H@@QAE@HH@Z) referenced in function _main
Error LNK2019 unresolved external symbol "public: int __thiscall TemplateTest<int>::bigger(void)" (?bigger@?$TemplateTest@H@@QAEHXZ) referenced in function _main
Heres my code:
1 2 3 4 5 6 7 8 9 10
#pragma once
template <class T>
class TemplateTest {
public:
TemplateTest(T x, T y);
T bigger();
private:
T data1, data2;
};