hi,

i have a set of numbers. now i want to search for a number and modify the match, if any found. so i code something like this...

set<int> list;

list.insert(1);
list.insert(2);
list.insert(3);
....

set<int>::iterator match = list.find(3);
if(match != list.end()) { // there is a match
*match = 7; // i want to modify the match to 7
}

however, it gives me a error since find() returns a const iterator and the contents cant be modifed.

do i need to convert my const interator (match) to a regular iterator. if so, how? are there other efficient ways to accomplish my goal?

thanks,
amit