Given the iterator in std :: list, how do you replace the object at the position that the iterator refers to? Currently, all I can think of is invoking an insert with a new object and an iterator (to insert a new object before the element that the iterator refers to), and then erasing it to remove the object to be replaced. Is there a less roundabout way to do a replacement?
source share