Hi, all -
I'm relatively new to iterators, and to template functions, so I suppose it was inevitable that the first time I tried to combine them, I'd run into a problem. Here's the function:
template <class T> int getVectort(ifstream & s,
long nbrCells,
typename vector<T>::iterator iter)
{
int rc = 0;
int32_t temp;
for (int i = 0; i < nbrCells; i++)
{
s >> hex >> temp;
*iter++ = temp;
}
if (s.fail())
rc = 1;
return rc;
}
It builds OK, but when I attempt to call it, like this:
rc = getVectort<int32_t>(fileIn, DEMOD_NBR_INPUTS, iter);
I get this error message:
error: no matching function for call to 'getVectort(std::ifstream&, const long int&, __gnu_cxx::__normal_iterator<FlipFlopReg32*, std::vector<FlipFlopReg32, std::allocator<FlipFlopReg32> > >&)'
(I can post more code if desired; I'm just trying to keep the thread brief.)
Can someone please tell me what I'm doing wrong here? Thanks!