<<< Using const iterator | Index | Mistakes when using iterators >>> |
Two iterators form a half-open range, closed on the left but open on the right.
insert( value )
uses an iterator to say where to insert a new item
returns iterator pointing to new element:
iterator insert( iterator it, T const& x = T() );
erase( )
uses an iterator to tell it where to erase a new item, or
erases a range of items;
returns an iterator that points to the next item after the deleted ones.
iterator erase( iterator it ); iterator erase( iterator first, iterator last );
<<< Using const iterator | Index | Mistakes when using iterators >>> |