Hello,

I am working on a template vector class. I have to have both a .h and .cpp file for this (already emailed teacher saying I that many people just put the implementation of template classes all in the same .h file). Anyway, I am running into an issue with overloading the operator =.

MyVector.h
Code:
MyVector& operator=(const MyVector &rhs);
MyVector.cpp
Code:
emplate <typename T>
MyVector& MyVector<T>::operator=(const MyVector &rhs)
{
    // Code here
}
The error I am getting is:

Code:
error: invalid use of template-name ‘MyVector’ without an argument list
I've not done much template work, so I am not sure what exactly this is getting at. Thanks for any help.

Edit:

If in the .cpp I change it to:
Code:
template <typename T>
MyVector<T>& MyVector<T>::operator=(const MyVector<T> &rhs)
{
    // Code here
}
Everything seems to work. Can someone explain this to me? Is this the right approach? I assume I need to specify the template type at each stage to indicate that this particular use of the = operator is of type T.

Thanks!