I want to change the element in a set
, so I used set<T>::iterator
. However, the compiler argues "the element is const". Then I realized that set<T>::iterator
is a const_iterator
...
So, how I can change the element? Erase it and then insert a new one?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…