I have a protobuf::mutable pointer,
auto del_list = message_my.mutable_del_list()
I want to delete its repeated_field.h which times below 10, so I use the function below:
for (auto del_item = del_list->begin(); del_item != del_list->end();) {
if (del_item->times() < 10) {
del_list->erase(del_item++);
continue;
}
del_item++;
}
but the program core dump because of it. Why?
I think I have noticed the iterator erase problem, why?