you need to define below function in header file itself instead of .cpp file.
template<typename T>
void pvector<T>::readvector()
{
ifstream ifs(filename);
for(;;)
{
T x; ifs >> x; if(!ifs.good()) break;
v.push_back(x);
}
}