Possible Duplicate:
C++ STL set update is tedious: I can't change an element in place
Why does this code complain that my argument is a const_iterator when it's not declared that way?
void foo(std::set<int>::iterator it)
{
*it=2;
}
I get error: assignment of read-only location ‘it.std::_Rb_tree_const_iterator<_Tp>::operator* with _Tp = int’