I want to do something like this
template <class T>
vector<T> DereferenceVector(vector<T*> &PointerVec)
{
vector<T> ObjectVec;
for(unsigned int i = 0; i < PointerVec.size(); i++)
ObjectVec.push_back(*PointerVec[i]);
return ObjectVec;
}
and call it with
void TestDereferenceVector()
{
vector<double*> a(10);
vector<double> b = DereferenceVector(a);
}
That seems to work. But if I do
void TestDereferenceVector()
{
vector<vgl_point_3d<double>*> a(10);
vector<vgl_point_3d<double> > b = DereferenceVector(a);
}
/media/portable/Projects/src/ModelFile/ModelFile.h:304: error: no matching function for call to 'DereferenceVector(const std::vector<vgl_point_3d<double>*, std::allocator<vgl_point_3d<double>*> >&)'
Why would it not work with a more complex type?
Thanks,
Dave