Hello all :)
I need to get a reference to an iterator of a reference. However, my compiler is choking on this code:
template <typename InputIterator> size_t iLongestBegin(InputIterator first, InputIterator last)
{
typedef typename std::iterator_traits<InputIterator>::reference SequenceT;
//Problem is next line
typedef typename std::iterator_traits<typename SequenceT::iterator>::reference T;
for(size_t idx; idx < first->length(); idx++)
{
T curChar = (*first)[idx];
for (InputIterator cur = first; cur != last; cur++)
{
if (cur->length() < idx)
return idx;
if (_tolower(cur->at(idx)) != _tolower(curChar))
return idx;
}
}
return first->length();
}
Any ideas on how to fix it? The error is
error C2825: 'SequenceT': must be a class or namespace when followed by '::'
Thanks! Billy3