std::move_backward
Da cppreference.com.
![]() |
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. |
Elemento definito nell'header <algorithm>
|
||
template< class BidirIt1, class BidirIt2 > BidirIt2 move_backward( BidirIt1 first, BidirIt1 last, BidirIt2 d_last ); |
||
Sposta gli elementi del
[first, last)
gamma, ad un altro finale gamma a d_last
. Gli elementi vengono spostati in ordine inverso (l'ultimo elemento viene spostato prima), ma il loro ordine relativo è conservato. Original:
Moves the elements from the range
[first, last)
, to another range ending at d_last
. The elements are moved in reverse order (the last element is moved first), but their relative order is preserved. 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
first, last | - | la gamma degli elementi da spostare
Original: the range of the elements to move The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
d_last | - | fine del campo di destinazione. Se d_last è all'interno [first, last) , NJ std :: mossa </ span> deve essere usato al posto di std::move_backward . Original: end of the destination range. If d_last is within [first, last) , NJ std :: mossa </ span> must be used instead of std::move_backward. </div>The text has been machine-translated via Google Translate. </div></div></div></div>
You can help to correct and verify the translation. Click here for instructions. |
Type requirements | ||
-BidirIt1, BidirIt2 must meet the requirements of BidirectionalIterator .
|
[modifica] Valore di ritorno
Iterator nella gamma di destinazione, indicando l'ultimo elemento spostato.
Original:
Iterator in the destination range, pointing at the last element moved.
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] Complessità
Esattamente
last - first
spostare le assegnazioni.Original:
Exactly
last - first
move assignments.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] Possibile implementazione
template< class BidirIt1, class BidirIt2 > BidirIt2 move_backward(BidirIt1 first, BidirIt1 last, BidirIt2 d_last) { while (first != last) { *(--d_last) = std::move(*(--last)); } return d_last; } |
[modifica] Esempio
This section is incomplete Reason: no example |
[modifica] Vedi anche
(C++11) |
sposta un intervallo di elementi in una nuova posizione Original: moves a range of elements to a new location The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione di modello) |