C++ Deque erase()
C++ Deque erase() function removes the element from the specified position or range and this effectively reduces the size of the deque by the number of elements removed.
pos: It defines the position at which the element to be removed from the deque.
(first,last): It defines the range within deque between which the elements to be removed.
It returns an iterator pointing to the element that followed the last element removed by the function.
Let's see a simple example when element is removed within a range.
Content of deque:1 2 3 4 After erasing second and third element,Content of deque:1 3 4
Let's see a simple example when the element is removed at the specified position
Content of deque:mango ,apple ,strawberry ,kiwi , Now,Content of deque:mango ,apple ,kiwi ,