Hi all!
I just wanted to code a template class and got the following problem:
Writing this in a header file work without problems:
template<class T>
class VectorArray
{
public:
T& operator [] (unsigned int index)
{
return T();
}
};
But writing this in a header file
template<class T>
class VectorArray
{
public:
T& operator [] (unsigned int index);
};
And this in a cpp file
template<class T>
T& VectorArray<T>::operator [] (unsigned int index);
{
return T();
}
will give me a linking error if I call operator []:
unresolved external symbol "public: int & __thiscall VectorArray
::operator[](unsigned int)"
I''m using MS Visual Studio .NET 2002.
Thanks for every help
--------------------------------------------------------
"If it looks good, it is good computer graphics"
"If it looks like computer graphics, it is bad computer graphics"
Corrail
corrail@gmx.at
ICQ#59184081
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...