when insert new element to list/map, it returns the iterator pointed to the newly added element.
But if insert failed, what does list/map return? I have read the references, when failed, list/map will not throw a exception.
map::insert returns pair of iterator and bool value. If insertion fails bool value is set to false.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With