J
Jay
Hi,
Can anyone tell me why the following code doesn't work on 7.1? It's been ok
with previous versions. The error given by the linker is:
rtwnd.obj : error LNK2019: unresolved external symbol "class TestT<bool>
__cdecl operator+(class TestT<bool> const &,class TestT<bool> const &)"
(??H@YA?AV?$TestT@_N@@ABV0@0@Z) referenced in function "void __cdecl
f(void)" (?f@@YAXXZ)
template <class T> class TestT
{
public:
friend TestT <T> operator+ (const TestT <T>&, const TestT <T>&);
};
template <class T> TestT <T> operator+ (const TestT <T>&, const TestT <T>&)
{
TestT <T> result;
return result;
}
void f ()
{
TestT <bool> t1, t2, t3;
t3 = t1 + t2;
}
Thanks,
Jay.
Can anyone tell me why the following code doesn't work on 7.1? It's been ok
with previous versions. The error given by the linker is:
rtwnd.obj : error LNK2019: unresolved external symbol "class TestT<bool>
__cdecl operator+(class TestT<bool> const &,class TestT<bool> const &)"
(??H@YA?AV?$TestT@_N@@ABV0@0@Z) referenced in function "void __cdecl
f(void)" (?f@@YAXXZ)
template <class T> class TestT
{
public:
friend TestT <T> operator+ (const TestT <T>&, const TestT <T>&);
};
template <class T> TestT <T> operator+ (const TestT <T>&, const TestT <T>&)
{
TestT <T> result;
return result;
}
void f ()
{
TestT <bool> t1, t2, t3;
t3 = t1 + t2;
}
Thanks,
Jay.