In last day’s log I refer to multiset delete as1
multiset.erase(multiset.find());
which will result in two finding operation in one call, making it rather inefficient. To avoid this, just using1
multiset.erase(index);
This will return an iterator to a single element once called.To get all the location of a certain index, consider using1
multiset.equal_range();
instead.
See more at: http://www.cplusplus.com/reference/set/multiset/find/