L
LiDongning
Hi,
I am trying to create a class nested in a template. Following piece of
codes works in Dev-C but can not be complied in VC6 with following
error message.
error LNK2001: unresolved external symbol "public: __thiscall
Ta<double>::Tb::Tb(double)" (??0Tb@?$Ta@N@@QAE@N@Z)
Could somebody give a helpful hand? Thanks much.
-------------------------------------------------------------------
template <class T>
class Ta
{
public:
class Tb
{
public:
T x;
Tb(T=T(0));
};
Tb u;
};
template <class T>
Ta<T>::Tb::Tb(T inx):x(inx)
{
}
int main(int argc, char *argv[])
{
Ta<double> xta;
Ta<double>::Tb xtab;
system("PAUSE");
return EXIT_SUCCESS;
}
I am trying to create a class nested in a template. Following piece of
codes works in Dev-C but can not be complied in VC6 with following
error message.
error LNK2001: unresolved external symbol "public: __thiscall
Ta<double>::Tb::Tb(double)" (??0Tb@?$Ta@N@@QAE@N@Z)
Could somebody give a helpful hand? Thanks much.
-------------------------------------------------------------------
template <class T>
class Ta
{
public:
class Tb
{
public:
T x;
Tb(T=T(0));
};
Tb u;
};
template <class T>
Ta<T>::Tb::Tb(T inx):x(inx)
{
}
int main(int argc, char *argv[])
{
Ta<double> xta;
Ta<double>::Tb xtab;
system("PAUSE");
return EXIT_SUCCESS;
}