kennen:lib:remove_copy
Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
remove_copy()
#include
<algorithm>
Out remove_copy (In first, In last, Out result, T wert) Out remove_copy (Exec pol, In first, In last, Out result, T wert) Out remove_copy_if (In first, In last, Out result, Pred pred) Out remove_copy_if (Exec pol, In first, In last, Out result, Pred pred) [last, res] = ranges::remove_copy (Range r, Out result, T wert, Proj proj = {}) [last, res] = ranges::remove_copy (In first, In last, Out result, T wert, Proj proj = {}) [last, res] = ranges::remove_copy_if (Range r, Out result, Pred pred, Proj proj = {}) [last, res] = ranges::remove_copy_if (In first, In last, Out result, Pred pred, Proj proj = {})
Kopiert den Bereich [first,last) nach [result,…)
und entfernt dabei alle Elemente e
mit dem angegebenen wert
bzw. auf die pred(proj(e))
zutrifft.
Parameter
first | Anfang des Bereiches |
last | Ende des Bereiches |
result | Anfang des Zielbereiches |
wert | zu entfernender Wert |
pred | einstelliges Prädikat |
proj | einstelliger Funktor (Vorgabe = std::identity ) |
pol | parallele Ausführungsart |
Ergebnis
Rückgabewert: Iterator result+N
auf das Ende des Zielbereiches bzw. {last,result+N}
mit N kopierten Elementen
als Struktur mit Elementen namens in, out
.
Siehe auch
Beispiel
- remove_copy.cpp
#include <algorithm> #include <iterator> #include <string> #include <iostream> int main() { std::string s = "Hallo, Welt"; std::string t; std::cout << s << '\n'; std::remove_copy(begin(s), end(s), std::back_inserter(t), 'l')); std::cout << t << '\n'; }
kennen/lib/remove_copy.1697277527.txt.gz · Zuletzt geändert: 2023-10-14 11:58 von rrichter