I have a QSet<quint64>, and i want to add 10 to every element in the Set. Since QSetIterator<> only supports const access, i tried using an STL-style iterator.
And sure enough it works - but only for const access. If i try to write to the element, i get a compile time error:
QSet<quint64> sss;
sss << 3 << 4 << 5;
for(QSet<quint64>::iterator it=sss.begin(); it!=sss.end(); ++it)
{
*it += 10;
}
QSet<quint64> sss;
sss << 3 << 4 << 5;
for(QSet<quint64>::iterator it=sss.begin(); it!=sss.end(); ++it)
{
*it += 10;
}
To copy to clipboard, switch view to plain text mode
error:
Error 1 error C3892: 'it' : you cannot assign to a variable that is const
i am using winxpx86sp3, VS2008SP1+QtPlugin, Qt 484.
Any ideas?
Bookmarks