Difference between revisions of "Template:cpp/container/erase"
From cppreference.com
(more wrong syntax) |
(finallly?) |
||
Line 36: | Line 36: | ||
===Complexity=== | ===Complexity=== | ||
− | + | {{#switch:{{{1|}}} | list= | |
1) {{complex constant}}. | 1) {{complex constant}}. | ||
Line 43: | Line 43: | ||
1) linear in the distance between {{tt|position}} and {{tt|last}}. | 1) linear in the distance between {{tt|position}} and {{tt|last}}. | ||
− | 2) linear in distance between {{tt|position}} and the end of the | + | 2) linear in distance between {{tt|position}} and the end of the {{{1}}}. |
}} | }} | ||
Revision as of 04:47, 26 September 2011
Template:cpp/container//sidebar Template:ddcl list begin <tr class="t-dcl ">
<td >iterator erase( iterator position );
iterator erase( const_iterator position );
</td>
iterator erase( const_iterator position );
<td > (1) </td>
<td > Template:mark pre c++11 version
Template:mark c++11 version </td>
</tr>
<tr class="t-dcl ">
iterator erase( iterator first, iterator last );
iterator erase( const_iterator first, const_iterator last );
</td>
iterator erase( const_iterator first, const_iterator last );
<td > (2) </td>
<td > Template:mark pre c++11 version
Template:mark c++11 version </td>
</tr>
Template:ddcl list end
Removes specified elements from the container.
1) Removes the element at pos
.
2) Removes the elements in the range [first; last)
.
Contents |
Parameters
pos | - | iterator to the element to remove |
first, last | - | range of elements to remove |
Return value
iterator following the last removed element.
Example
Complexity
1) linear in the distance between position
and last
.
2) linear in distance between position
and the end of the {{{1}}}.