std::copy, std::copy_if
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| Déclaré dans l'en-tête <algorithm>
|
||
template< class InputIt, class OutputIt > OutputIt copy( InputIt first, InputIt last, OutputIt d_first ); |
(1) | |
template< class InputIt, class OutputIt, class UnaryPredicate > OutputIt copy_if( InputIt first, InputIt last, OutputIt d_first, UnaryPredicate pred ); |
(2) | (depuis C++11) |
Copier les éléments de la gamme, défini par
[first, last), dans un autre intervalle au début d_first. La deuxième fonction ne copie que les éléments pour lesquels le prédicat renvoie pred true . Original:
Copies the elements in the range, defined by
[first, last), to another range beginning at d_first. The second function only copies the elements for which the predicate pred returns true. 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.
Paramètres
| first, last | - | l'éventail des éléments à copier
Original: the range of elements to copy The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| d_first | - | le début de la plage de destination. Si
d_first est dans [first, last), std::copy_backward doit être utilisé à la place de std::copy . Original: the beginning of the destination range. If d_first is within [first, last), std::copy_backward must be used instead of std::copy. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| pred | - | prédicat unéaire qui retourne true pour les éléments requis . Original: for the required elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. L'expression |
| Type requirements | ||
-InputIt must meet the requirements of InputIterator.
| ||
-OutputIt must meet the requirements of OutputIterator.
| ||
Retourne la valeur
Itérateur de sortie de l'élément dans la zone de destination, une après le dernier élément copié .
Original:
Output iterator to the element in the destination range, one past the last element copied.
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.
Complexité
1)
Exactement
last - first missionsOriginal:
Exactly
last - first assignmentsThe 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)
Exactement
last - first applications du prédicatOriginal:
Exactly
last - first applications of the predicateThe text has been machine-translated via