kennen:lib:remove_copy_if
Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
remove_copy_if()
#include
<algorithm>
Out remove_copy_if(In first, In last, Out result, Pred pred)
Kopiert den Bereich [first,last) nach [result,…)
und entfernt dabei alle Elemente, auf die pred(x)
zutrifft.
Parameter
first | Anfang des Bereiches |
last | Ende des Bereiches |
result | Anfang des Zielbereiches |
pred | einstelliges Prädikat |
Ergebnis
Rückgabewert: Iterator auf das Ende des Zielbereiches.
Siehe auch
Beispiel
- remove_copy_if.cpp
#include <algorithm> #include <functional> #include <iterator> #include <string> #include <iostream> int main() { std::string s = "Hallo, Welt"; std::string t; std::cout << s << '\n'; std::remove_copy_if(begin(s), end(s), std::back_inserter(t), [](char c) { return c < 'l'; }); std::cout << t << '\n'; return 0; }
kennen/lib/remove_copy_if.1334157841.txt.gz · Zuletzt geändert: 2012-04-11 17:24 von 127.0.0.1