I whant to iterate in a member function over a list. In this code sample I am getting compiler error in for-line:
Expected ; before it, it not declared, end not declared.
Why? The function is even not used in code!
template <class T> bool Settings::saveSimpleList( QString k, const T & l ){
//...
for ( T::ConstIterator it = l.constBegin(), end =l.constEnd(); it != end; ++it )
{
QString itemValue = QVariant( *it ).toString();
//...
}
return true;
}
I see, I am missing something in template programming. Thank you for your hints!