can't increment Glib::ustring::iterator (getting "invalid lvalue in increment" compiler error)
- by davka
in the following code:
int utf8len(char* s, int len)
{
Glib::ustring::iterator p( string::iterator(s) );
Glib::ustring::iterator e ( string::iterator(s+len) );
int i=0;
for (; p != e; p++) // ERROR HERE!
i++;
return i;
}
I get the compiler error on the for line, which is sometimes "invalid lvalue in increment", and sometimes "ISO C++…