Y
yaru22
When I look at the C++ reference, erase method for map takes an
iterator as a parameter. I'm wondering why it takes iterator instead
of key value. Wouldn't it be faster to take key value and erase the
object? (because lookup operation using key value would be faster than
creating an iterator and iterate through the map?)
iterator as a parameter. I'm wondering why it takes iterator instead
of key value. Wouldn't it be faster to take key value and erase the
object? (because lookup operation using key value would be faster than
creating an iterator and iterate through the map?)