Hello all,
For a program of mine I made a small function to clear the various std::vectors of pointers that I have.
template <class S>
void clearPtrVector(std::vector<S*> &a,int size)
{
for(size_t i = 0; i < size; i++)
delete a[i];
a.clear();
}
I must have done something wrong here though since when calling this function in a destructor like so :
clearPtrVector(neurons,neurons.size());
I get the following undefined reference two times:
undefined reference to `void clearPtrVector<Neuron>(std::vector<Neuron*,std::allocator<Neuron*> >&, int)'
I have to admit I am not familiar with what the std::allocator is, so I can not guess what the problem might be here. Any help is really appreciated. Thanks in advance!
-Lefteris