Considering the code below,
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
vector<int> value{22, 23, 25, 34, 99};
auto it = find(value.cbegin(), value.cend(), 25);
value.insert(it, 77);
return 0;
}
Here it
is a const_iterator
. Before the insertion, it points to 25
. After the insertion, it points to 77
. Wouldn't this be considered a modification?