Discuss anything that might be problematic about either solution. Three objects had to be removed, and the rest were copied to fill in the gaps. Again, note that the size of the container is left unchanged. A programmer working on your team wrote the following alternative pieces of code to remove the n-th element of a container. Implement the missing part of Method 1.
People often propose implementations that have the same bug as the following code.
It would be fine to leave that potential problem in the function, as long as you also documented a precondition that n be valid for the given range. Discuss anything that might be problematic about either solution. It is correct. It can take advantage of iterator traits, specifically the iterator category, and so can perform better for random-access iterators.