std::forward_list::erase_after
Da cppreference.com.
< cpp | container | forward list
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
| iterator erase_after( const_iterator position ); |
(1) | (dal C++11) |
| iterator erase_after( const_iterator first, const_iterator last ); |
(2) | (dal C++11) |
Rimuove gli elementi specificati dal contenitore.
1) Original:
Removes specified elements from the container.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Rimuove l'
2) pos seguente elemento.Original:
Removes the element following
pos.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Rimuove gli elementi della gamma
(first; last).Original:
Removes the elements in the range
(first; last).The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Indice |
[modifica] Parametri
| pos | - | iteratore all'elemento che precede l'elemento da rimuovere
Original: iterator to the element preceding the element to remove The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| first, last | - | intervallo di elementi da rimuovere
Original: range of elements to remove The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[modifica] Valore di ritorno
1)iteratore all'elemento successivo alla cancellata, oppure
end() se tale elemento non esiste.Original:
iterator to the element following the erased one, or
end() if no such element exists.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
2) last
[modifica] Complessità
1)Costante.
2) Original:
Constant.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
lineare di distanza tra
first e last.Original:
linear in distance between
first and last.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[modifica] Esempio
#include <forward_list> #include <iterator> #include <iostream> int main() { std::forward_list<int> l = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; // l.erase( l.begin() ); // ERROR: No function erase l.erase_after( l.before_begin() ); // Removes first element for( auto n : l ) std::cout << n << " "; std::cout << '\n'; auto fi= std::next( l.begin() ); auto la= std::next( fi, 3 ); l.erase_after( fi, la ); for( auto n : l ) std::cout << n << " "; std::cout << '\n'; }
Output:
2 3 4 5 6 7 8 9 2 3 6 7 8 9
[modifica] Vedi anche
| cancella il contenuto Original: clears the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro pubblico funzione) | |