namespace cpp {}

C++ lernen, kennen, anwenden

Benutzer-Werkzeuge

Webseiten-Werkzeuge


kennen:include:algorithm

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.


Vorhergehende Überarbeitung
kennen:include:algorithm [2023-10-14 12:24] (aktuell) – [<algorithm>] rrichter
Zeile 1: Zeile 1:
 +====== <algorithm> ======
 +Typ-parametrisierte [[..:stl#Algorithmen]]:
 +| [[#nichtmodifizierende Algorithmen]]| [[#Prädikatenlogik]], [[#Suchen]],  [[#Vergleichen]]|
 +| [[#modifizierende Algorithmen]]| [[#Tauschen]], [[#Kopieren]], [[#Verschieben]], [[#Füllen]], [[#Ersetzen]], [[#Entfernen]], [[#Umwandeln]]|
 +| [[#mutierende Algorithmen]]| [[#Umkehren]], [[#Rotieren]], [[#Durcheinanderbringen]], [[#Systematisches Umordnen]],\\ [[#Sortieren]], [[#Aufteilen]], [[#Mischen]], [[#Mengenoperationen]], [[#Heapoperationen]]|
 +
 +**Warnung**:​  
 +Die "​Kopfzeilen"​ der aufgeführten Algorithmen sind absichtlich **kein korrektes C++**.  
 +Für syntaktisch korrekte Dokumentation sei auf [[https://​en.cppreference.com/w/cpp/algorithm]] und [[https://​en.cppreference.com/w/cpp/algorithm/ranges]] verwiesen.  
 + 
 +Die Einleitung ''%%template <...>%%'' wurde der Übersichtlichkeit halber bei allen Schablonen weggelassen.
 +Die Iterator-[[..:stl#Kategorien]] ''Out'', ''In'', ''For'', ''Bi'' und ''Ran'' zeigen an, welche Operationen auf den Bereichen erforderlich sind.
 +Mit ''Binary'' und ''Pred'' werden Funktionen, Funktionsobjekte und Lambdaausdrücke bezeichnet, die boolesche Rückgabewerte liefern.
 +
 +Erweiterungen in C++17: 
 +[[..:parallel_algorithms]] besitzen einen [[execution]]-Policy-Parameter, hier durch ''Exec pol'' gekennzeichnet. 
 +
 +Erweiterungen in C++20:
 +Als ''Range'' werden Ausdrücke ''r'' bezeichnet, auf die ''%%std::ranges::begin(r)%%'' und ''%%std::ranges::end(r)%%'' angewendet werden kann.
 +Projektionen ''proj(e)''((genauer: ''std::invoke(proj,e)'')) sind Funktionen, Funktionsobjekte, Lambdaausdrücke oder Adressen wie ''&Person::name'' von Bestandteilen eines zusammengesetzten Objekts, die auf ein Element ''e'' eines Bereichs ''r'' angewendet werden können. Die Standardvorgabe ''std::identity{}'' liefert ''e'' selbst.
 +Steht an Stelle eines Ergebnistyps ''​[x,​y] ='',​ liefert der Algorithmus eine zusammengesetzte Struktur, die mittels eines "​structured bindings"​ zerlegt werden kann: 
 +
 +<code cpp>
 +auto [x,y] = f(...);
 +
 +auto result = f(...);
 +std::cout << result.name1 << ' ' << result.name2; 
 +</code>
 +Alternativ kann auf die Bestandteile der Rückgabestruktur per Namen zugegriffen werden.
 +Dazu muss man allerdings deren Namen kennen. 
 +Diese werden in der Beschreibung der Algorithmen aufgeführt.  
 +
 +===== Nichtmodifizierende Algorithmen =====
 +==== Ausführen und Zählen ====
 +<code cpp>
 +Function for_each (In first, In last, Function f) 
 +Function for_each (Exec pol, In first, In last, Function f) 
 +
 +[last, f] = ranges::for_each (Range r, Function f, Proj proj = {})
 +[last, f] = ranges::for_each (In first, In last, Function f, Proj proj = {})
 +</code>
 +[[..:lib:for_each|Beschreibung]]:
 + Wendet ''f(proj(e))'' auf jedes Element ''e'' des Bereiches [first,last) an.
 + Obwohl der Algorithmus die Elemente nicht verändert, ist es dem Funktions(objekt)aufruf ''f(proj(e))'' ausdrücklich erlaubt.
 +
 +<code cpp>
 +difference_type count (In first, In last, T wert) 
 +difference_type count (Exec pol, In first, In last, T wert) 
 +
 +difference_type ranges::count (Range r, T wert, Proj proj = {}) 
 +difference_type ranges::count (In first, In last, T wert, Proj proj = {}) 
 +</code>
 +[[..:lib:count|Beschreibung]]:
 + Liefert die Anzahl der Elemente des Bereiches [first,last) mit ''proj(wert)''
 +
 +<code cpp>
 +difference_type count_if (In first, In last, Pred pred) 
 +difference_type count_if (Exec pol, In first, In last, Pred pred) 
 +
 +difference_type ranges::count_if (Range r, Pred pred, Proj proj = {}) 
 +difference_type ranges::count_if (In first, In last, Pred pred, Proj proj = {}) 
 +</code>
 +[[..:lib:count_if|Beschreibung]]:
 + Liefert die Anzahl der Elemente ''e'' des Bereiches [first,last), auf die das Prädikat ''pred(proj(e))'' zutrifft.
 +
 +==== Prädikatenlogik ====
 +<code cpp>
 +bool all_of (In first, In last, Pred pred)
 +bool all_of (Exec pol, In first, In last, Pred pred)
 +
 +bool ranges::all_of (Range r, Pred pred, Proj proj = {})
 +bool ranges::all_of (In first, In last, Pred pred, Proj proj = {})
 +</code>
 +[[..:lib:all_of|Beschreibung]]:
 + Prüft, ob alle Elemente ''e'' des Bereiches [first,last) das Prädikat ''pred(proj(e))'' erfüllen.
 + Bei leerem Bereich liefert die Funktion ''true''
 +
 +<code cpp>
 +bool any_of (In first, In last, Pred pred) 
 +bool any_of (Exec pol, In first, In last, Pred pred) 
 +
 +bool ranges::any_of (Range r, Pred pred, Proj proj = {})
 +bool ranges::any_of (In first, In last, Pred pred, Proj proj = {})
 +</code>
 +[[..:lib:any_of|Beschreibung]]:
 + Prüft, ob irgendein Element ''e'' des Bereiches [first,last) das Prädikat ''pred(proj(e))'' erfüllt.
 + Bei leerem Bereich liefert die Funktion ''false''
 +
 +<code cpp>
 +bool none_of (In first, In last, Pred pred) 
 +bool none_of (Exec pol, In first, In last, Pred pred) 
 +
 +bool ranges::none_of (Range r, Pred pred, Proj proj = {})
 +bool ranges::none_of (In first, In last, Pred pred, Proj proj = {})
 +</code>
 +[[..:lib:none_of|Beschreibung]]:
 + Prüft, ob kein Element ''e'' des Bereiches [first,last) das Prädikat ''pred(proj(e))'' erfüllt.
 + Bei leerem Bereich liefert die Funktion ''true''
 +
 +==== Suchen ====
 +<code cpp>
 +In find (In first, In last, T wert) 
 +In find (Exec pol, In first, In last, T wert) 
 +
 +In ranges::find (Range r, T wert, Proj proj = {}) 
 +In ranges::find (In first, In last, T wert, Proj proj = {}) 
 +</code>
 +[[..:lib:find|Beschreibung]]:
 + Liefert einen Iterator ''i'' auf das erste Element des Bereiches [first,last) mit ''proj(*i) == wert''
 +
 +<code cpp>
 +In find_if (In first, In last, Pred pred) 
 +In find_if (Exec pol, In first, In last, Pred pred) 
 +
 +In ranges::find_if (Range r, Pred pred, Proj proj = {}) 
 +In ranges::find_if (In first, In last, Pred pred, Proj proj = {}) 
 +</code>
 +[[..:lib:find_if|Beschreibung]]:
 + Liefert einen Iterator ''i'' auf das erste Element des Bereiches [first,last), 
 +auf den das Prädikat ''pred(proj(*i))'' zutrifft.
 +
 +<code cpp>
 +In find_if_not (In first, In last, Pred pred) 
 +In find_if_not (Exec pol, In first, In last, Pred pred) 
 +
 +In ranges::find_if_not (Range r, Pred pred, Proj proj = {}) 
 +In ranges::find_if_not (In first, In last, Pred pred, Proj proj = {}) 
 +</code>
 +[[..:lib:find_if_not|Beschreibung]]:
 + Liefert einen Iterator ''i'' auf das erste Element des Bereiches [first,last), 
 +auf den das Prädikat ''pred(proj(*i))'' nicht zutrifft.
 +
 +<code cpp>
 +For find_first_of (For first, For last, For2 first2, For2 last2) 
 +For find_first_of (For first, For last, For2 first2, For2 last2, Binary pred) 
 +For find_first_of (Exec pol, For first, For last, For2 first2, For2 last2) 
 +For find_first_of (Exec pol, For first, For last, For2 first2, For2 last2, Binary pred) 
 +
 +For ranges::find_first_of (Range1 r1, Range2 r2, Binary pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +For ranges::find_first_of (For first, For last, For2 first2, For2 last2, Binary pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +</code>
 +[[..:lib:find_first_of|Beschreibung]]:
 + Liefert einen Iterator ''i'' auf das erste Element ''x'' des Bereiches [first,last), 
 + das mit einem Element ''y'' des Bereiches [first2,last2) übereinstimmt bzw. 
 + für welches ''pred(proj1(x), proj2(y))'' zutrifft.
 +<code cpp>
 +For search (For first, For last, For2 first2, For2 last2) 
 +For search (For first, For last, For2 first2, For2 last2, Binary pred) 
 +For search (Exec pol, For first, For last, For2 first2, For2 last2) 
 +For search (Exec pol, For first, For last, For2 first2, For2 last2, Binary pred) 
 +
 +Range ranges::search (Range1 r1, Range2 r2, Binary pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +Range ranges::search (For first, For last, For2 first2, For2 last2, Binary pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +
 +For search (For first, For last, Searcher searcher) // C++17
 +</code>
 +[[..:lib:search|Beschreibung]]:
 +Sucht den Anfang eines Teilbereiches (den Teilbereich) aus [first,last), 
 + der mit [first2,last2) übereinstimmt, das Prädikat ''pred(proj1(x),proj2(y))'' erfüllt bzw. 
 + dem Muster eines [[..:lib:search#Sucher]]-Objekts entspricht. 
 +<code cpp>
 +For search_n (For first, For last, Size n, T wert) 
 +For search_n (For first, For last, Size n, T wert, Binary pred) 
 +For search_n (Exec pol, For first, For last, Size n, T wert) 
 +For search_n (Exec pol, For first, For last, Size n, T wert, Binary pred) 
 +
 +Range ranges::search_n (Range r, Size n, T wert, Binary pred = {}, Proj proj = {}) 
 +Range ranges::search_n (For first, For last, Size n, T wert, Binary pred = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:search_n|Beschreibung]]:
 + Sucht den Anfang eines Teilbereiches (den Teilbereich) aus [first,last), 
 + der ''n'' gleiche Werte hat bzw. auf den ''n'' mal ''pred(proj(x),wert)'' zutrifft.
 +
 +<code cpp>
 +For find_end (For first, For last, For2 first2, For2 last2) 
 +For find_end (For first, For last, For2 first2, For2 last2, Binary pred) 
 +For find_end (Exec pol, For first, For last, For2 first2, For2 last2) 
 +For find_end (Exec pol, For first, For last, For2 first2, For2 last2, Binary pred) 
 +
 +Range ranges::find_end (Range1 r1, Range2 r2, Binary pred = {}, Proj1 proj1, Proj2 proj2) 
 +Range ranges::find_end (For first, For last, For2 first2, For2 last2, Binary pred = {}, Proj1 proj1, Proj2 proj2) 
 +</code>
 +[[..:lib:find_end|Beschreibung]]:
 + Findet den letzten Teilbereich aus [first,last), 
 + der mit [first2,last2) übereinstimmt bzw. 
 + für dessen Elemente ''x'' das Prädikat ''pred(proj1(x), proj2(y))'' mit den entsprechenden Elementen y aus [first2,last2) zutrifft.
 +
 +<code cpp>
 +For adjacent_find (For first, For last) 
 +For adjacent_find (For first, For last, Binary pred) 
 +For adjacent_find (Exec pol, For first, For last) 
 +For adjacent_find (Exec pol, For first, For last, Binary pred) 
 +
 +For ranges::adjacent_find (Range r, Binary pred = {}, Proj = {}) 
 +For ranges::adjacent_find (For first, For last, Binary pred = {}, Proj = {}) 
 +</code>
 +[[..:lib:adjacent_find|Beschreibung]]:
 + Liefert einen Iterator ''i'' auf das erste Element des Bereiches [first,last), 
 + das mit seinem Nachfolger übereinstimmt bzw. 
 + mit seinem Nachfolger das Prädikat ''pred(proj(*i),proj(*(i+1)))'' erfüllt.
 +
 +==== Binärsuche ====
 +<code cpp>
 +bool binary_search (For first, For last, T wert) 
 +bool binary_search (For first, For last, T wert, Binary comp) 
 +
 +bool ranges::binary_search (Range r, T wert, Binary comp = {}, Proj proj = {}) 
 +bool ranges::binary_search (For first, For last, T wert, Binary comp = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:binary_search|Beschreibung]]:
 + Prüft, ob ''wert'' (als Projektion) in der aufsteigend geordneten Folge [first,last) enthalten ist.
 +
 +<code cpp>
 +For lower_bound (For first, For last, T wert) 
 +For lower_bound (For first, For last, T wert, Binary comp) 
 +
 +For ranges::lower_bound (Range r, T wert, Binary comp = {}, Proj proj = {}) 
 +For ranges::lower_bound (For first, For last, T wert, Binary comp = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:lower_bound|Beschreibung]]:
 + Bestimmt die erste Position, an der ein Element eingefügt werden kann, 
 + ohne die aufsteigende Ordnung der Folge [first,last) zu zerstören.
 +
 +<code cpp>
 +For upper_bound (For first, For last, T wert) 
 +For upper_bound (For first, For last, T wert, Binary comp) 
 +
 +For ranges::upper_bound (Range r, T wert, Binary comp = {}, Proj proj = {}) 
 +For ranges::upper_bound (For first, For last, T wert, Binary comp = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:upper_bound|Beschreibung]]:
 + Bestimmt die letzte Position, an der ein Element eingefügt werden kann, 
 + ohne die aufsteigende Ordnung der Folge [first,last) zu zerstören.
 +
 +<code cpp>
 +std::pair<For, For> equal_range (For first, For last, T wert) 
 +std::pair<For, For> equal_range (For first, For last, T wert, Comp comp) 
 +
 +Range ranges::equal_range (Range r, T wert, Binary comp = {}, Proj proj = {}) 
 +Range ranges::equal_range (For first, For last, T wert, Binary comp = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:equal_range|Beschreibung]]:
 + Bestimmt den Teilbereich der aufsteigend geordneten Folge [first,last), 
 + der mit dem ''wert'' übereinstimmt.
 +
 +==== Minimum und Maximum ====
 +<code cpp>
 +const T& min (const T& a, const T& b) 
 +const T& min (const T& a, const T& b, Binary comp)
 +T min (std::initializer_list<T> values)  
 +T min (std::initializer_list<T> values, Binary comp)  
 +
 +const T& ranges::min (const T& a, const T& b, Binary comp = {}, Proj proj = {})
 +T ranges::min (std::initializer_list<T> values, Binary comp = {}, Proj proj = {})
 +T ranges::min (Range r, Binary comp = {}, Proj proj = {})
 +</code>
 +[[..:lib:min|Beschreibung]]:
 + Liefert den kleinsten Wert.
 +
 +<code cpp>
 +const T& max (const T& a, const T& b) 
 +const T& max (const T& a, const T& b, Binary comp) 
 +T max (std::initializer_list<T> values)  
 +T max (std::initializer_list<T> values, Binary comp)  
 +
 +const T& ranges::max (const T& a, const T& b, Binary comp = {}, Proj proj = {})
 +T ranges::max (std::initializer_list<T> values, Binary comp = {}, Proj proj = {})
 +T ranges::max (Range r, Binary comp = {}, Proj proj = {})
 +</code>
 +[[..:lib:max|Beschreibung]]:
 + Liefert den größten Wert.
 +
 +<code cpp>
 +std::pair<T,T> minmax (const T& a, const T& b) 
 +std::pair<T,T> minmax (const T& a, const T& b, Binary comp)
 +std::pair<T,T> minmax (std::initializer_list<T> values)  
 +std::pair<T,T> minmax (std::initializer_list<T> values, Binary comp)  
 +
 +[min,max] = ranges::minmax (const T& a, const T& b, Binary comp = {}, Proj proj = {})
 +[min,max] = ranges::minmax (std::initializer_list<T> values, Binary comp = {}, Proj proj = {})
 +[min,max] = ranges::minmax (Range r, Binary comp = {}, Proj proj = {})
 +</code>
 +[[..:lib:minmax|Beschreibung]]:
 + Liefert kleinsten und größten Wert als geordnetes Paar (first %%<=%% second).
 +
 +<code cpp>
 +For min_element (For first, For last) 
 +For min_element (For first, For last, Binary comp) 
 +For min_element (Exec pol, For first, For last) 
 +For min_element (Exec pol, For first, For last, Binary comp) 
 +
 +For ranges::min_element (Range r, Binary comp = {}, Proj proj = {})
 +For ranges::min_element (For first, For last, Binary comp = {}, Proj proj = {})
 +</code>
 +[[..:lib:min_element|Beschreibung]]:
 + Liefert einen Iterator auf das kleinste Element des Bereiches [first,last).
 +
 +<code cpp>
 +For max_element (For first, For last) 
 +For max_element (For first, For last, Binary comp) 
 +For max_element (Exec pol, For first, For last) 
 +For max_element (Exec pol, For first, For last, Binary comp) 
 +
 +For ranges::max_element (Range r, Binary comp = {}, Proj proj = {})
 +For ranges::max_element (For first, For last, Binary comp = {}, Proj proj = {})
 +</code>
 +[[..:lib:max_element|Beschreibung]]:
 + Liefert einen Iterator auf das größte Element des Bereiches [first,last).
 +
 +<code cpp>
 +std::pair<For,For> minmax_element (For first, For last) 
 +std::pair<For,For> minmax_element (For first, For last, Binary comp) 
 +std::pair<For,For> minmax_element (Exec pol, For first, For last) 
 +std::pair<For,For> minmax_element (Exec pol, For first, For last, Binary comp) 
 +
 +Range ranges::minmax_element (Range r, Binary comp = {}, Proj proj = {})
 +Range ranges::minmax_element (For first, For last, Binary comp = {}, Proj proj = {})
 +</code>
 +[[..:lib:minmax_element|Beschreibung]]:
 + Liefert am weitesten links stehende Minimumposition und am weitesten rechts stehende Maximumposition als Paar {m,M}. 
 +
 +<code cpp>
 +const T& clamp (const T& value, const T& low, const T& high)              // C++17
 +const T& clamp (const T& value, const T& low, const T& high, Binary comp) 
 +</code>
 +[[..:lib:clamp|Beschreibung]]:
 + Begrenzt Wert auf das Intervall [low,high].
 +
 +==== Vergleichen ====
 +<code cpp>
 +bool equal (For first, For last, For2 first2) 
 +bool equal (For first, For last, For2 first2, Binary pred) 
 +bool equal (For first, For last, For2 first2, For2 last2) 
 +bool equal (For first, For last, For2 first2, For2 last2, Binary pred) 
 +bool equal (Exec pol, For first, For last, For2 first2) 
 +bool equal (Exec pol, For first, For last, For2 first2, Binary pred) 
 +bool equal (Exec pol, For first, For last, For2 first2, For2 last2) 
 +bool equal (Exec pol, For first, For last, For2 first2, For2 last2, Binary pred) 
 +
 +bool ranges::equal (Range1 r1, Range2 r2, Binary pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +bool ranges::equal (For first, For last, For2 first2, For2 last2, Binary pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +</code>
 +[[..:lib:equal|Beschreibung]]:
 + Ist wahr, wenn die Bereiche [first,last) und [first2,...) elementweise übereinstimmen bzw. 
 + paarweise das Prädikat ''pred(proj1(x),proj2(y))'' erfüllen.
 +
 +<code cpp>
 +bool lexicographical_compare (In first, In last, In2 first2, In2 last2) 
 +bool lexicographical_compare (In first, In last, In2 first2, In2 last2, Binary comp) 
 +bool lexicographical_compare (Exec pol, In first, In last, In2 first2, In2 last2) 
 +bool lexicographical_compare (Exec pol, In first, In last, In2 first2, In2 last2, Binary comp) 
 +
 +bool ranges::lexicographical_compare (Range1 r1, Range2 r2, Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +bool ranges::lexicographical_compare (In first, In last, In2 first2, In2 last2, Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +</code>
 +[[..:lib:lexicographical_compare|Beschreibung]]:
 + Ist wahr, wenn der Bereich [first,last) lexikographisch vor [first2,last2) einzuordnen ist.
 +
 +<code cpp>
 +std::pair<In, In2> mismatch (In first, In last, In2 first2) 
 +std::pair<In, In2> mismatch (In first, In last, In2 first2, Binary pred) 
 +std::pair<In, In2> mismatch (In first, In last, In2 first2, In2 last2) 
 +std::pair<In, In2> mismatch (In first, In last, In2 first2, In2 last2, Binary pred) 
 +std::pair<In, In2> mismatch (Exec pol, In first, In last, In2 first2) 
 +std::pair<In, In2> mismatch (Exec pol, In first, In last, In2 first2, Binary pred) 
 +std::pair<In, In2> mismatch (Exec pol, In first, In last, In2 first2, In2 last2) 
 +std::pair<In, In2> mismatch (Exec pol, In first, In last, In2 first2, In2 last2, Binary pred)
 +
 +[pos1, pos2] = ranges::mismatch (Range1 r1, Range2 r2, Binary pred = {}, Proj1 proj = {}, Proj2 proj2 = {})
 +[pos1, pos2] = ranges::mismatch (In first, In last, In2 first2, In2 last2, Binary pred = {}, Proj1 proj = {}, Proj2 proj2 = {})
 +</code>
 +[[..:lib:mismatch|Beschreibung]]:
 + Liefert ein Paar von Iteratoren ''{pos1, pos2}'', 
 + ab denen die Bereiche [first,last) und [first2,...) nicht mehr übereinstimmen bzw. 
 + das Prädikat ''pred(proj1(pos1),proj2(pos2))'' nicht mehr erfüllen.
 +
 +===== Modifizierende Algorithmen =====
 +
 +==== Tauschen ====
 +<code cpp>
 +void iter_swap (Iter a, Iter b) 
 +</code>
 +[[..:lib:iter_swap|Beschreibung]]:
 + Vertauscht die Werte der Objekte, auf die die Iteratoren von ''a'' und ''b'' verweisen.
 +
 +<code cpp>
 +For2 swap_ranges (For first, For last, For2 first) 
 +For2 swap_ranges (Exec pol, For first, For last, For2 first) 
 +
 +[pos, pos2] = ranges::swap_ranges (Range1 r1, Range2 r2) 
 +[pos, pos2] = ranges::swap_ranges (For first, For last, For2 first, For2 Last2) 
 +</code>
 +[[..:lib:swap_ranges|Beschreibung]]:
 + Tauscht die Werte in den Bereichen [first,last) und [first2,...) aus.
 +
 +==== Kopieren ====
 +<code cpp>
 +Out copy (In first, In last, Out result) 
 +Out copy (Exec pol, In first, In last, Out result) 
 +
 +[last, res] = ranges::copy (Range r, Out result) 
 +[last, res] = ranges::copy (In first, In last, Out result) 
 +</code>
 +[[..:lib:copy|Beschreibung]]:
 + Kopiert die Werte des Bereiches [first,last) nach [result,...).
 +
 +<code cpp>
 +Out copy_if (In first, In last, Out result, Pred pred) 
 +Out copy_if (Exec pol, In first, In last, Out result, Pred pred) 
 +
 +[last, res] = ranges::copy_if (Range r, Out result, Pred pred, Proj = proj = {}) 
 +[last, res] = ranges::copy_if (In first, In last, Out result, Pred pred, Proj = proj = {}) 
 +</code>
 +[[..:lib:copy_if|Beschreibung]]:
 + Kopiert die Werte ''e'' des Bereiches [first,last) nach [result,...), die das Prädikat ''pred(proj(e))'' erfüllen.
 +
 +<code cpp>
 +Out copy_n (In first, Size n, Out result) 
 +Out copy_n (Exec pol, In first, Size n, Out result) 
 +
 +[last, res] = ranges::copy_n (In first, Size n, Out result) 
 +</code>
 +[[..:lib:copy_n|Beschreibung]]:
 + Kopiert ''n'' Werte des Bereiches [first,first+n) nach [result,...).
 +
 +<code cpp>
 +Bi2 copy_backward (Bi first, Bi last, Bi2 result) 
 +
 +[last, res] = ranges::copy_backward (Range r, Bi2 result) 
 +[last, res] = ranges::copy_backward (Bi first, Bi last, Bi2 result) 
 +</code>
 +[[..:lib:copy_backward|Beschreibung]]:
 + Kopiert die Werte des Bereiches [first,last) am Ende beginnend nach [result - (last-first),result).
 +
 +==== Verschieben ====
 +<code cpp>
 +Out move (In first, In last, Out result) 
 +Out move (Exec pol, In first, In last, Out result) 
 +
 +[last, res] = ranges::move (Range r, Out result) 
 +[last, res] = ranges::move (In first, In last, Out result) 
 +</code>
 +[[..:lib:move|Beschreibung]]:
 + Verschiebt die Elemente des Bereiches [first,last) nach [result,...).
 +
 +<code cpp>
 +[last, res] = ranges::move_backward (Range r, Bi2 result) 
 +[last, res] = ranges::move_backward (Bi first, Bi last, Bi2 result) 
 +</code>
 +[[..:lib:move_backward|Beschreibung]]:
 + Verschiebt die Elemente des Bereiches [first,last) am Ende beginnend nach [result - (last-first),result).
 +
 +
 +==== Füllen ====
 +<code cpp>
 +void fill (Out first, Out last, T wert) 
 +void fill (Exec pol, Out first, Out last, T wert) 
 +
 +Out ranges::fill (Range r, T wert) 
 +Out ranges::fill (Out first, Out last, T wert) 
 +</code>
 +[[..:lib:fill|Beschreibung]]:
 + Füllt den Bereich [first,last) mit dem ''wert''.
 +
 +<code cpp>
 +void fill_n (Out first, Size n, T wert) 
 +void fill_n (Exec pol, Out first, Size n, T wert) 
 +
 +Out ranges::fill_n (Out first, Size n, T wert) 
 +</code>
 +[[..:lib:fill_n|Beschreibung]]:
 + Füllt in den bei ''first'' beginnenden Bereich ''n'' mal den ''wert''.
 +
 +<code cpp>
 +void generate (Out first, Out last, Func generator_obj) 
 +void generate (Exec pol, Out first, Out last, Func generator_obj) 
 +
 +Out ranges::generate (Range r, Func generator_obj) 
 +Out ranges::generate (Out first, Out last, Func generator_obj) 
 +</code>
 +[[..:lib:generate|Beschreibung]]:
 + Füllt den Bereich [first,last) mit der durch ''generator_obj'' erzeugten Folge von Werten.
 +
 +<code cpp>
 +void generate_n (Out first, Size n, Func generator_obj) 
 +void generate_n (Exec pol, Out first, Size n, Func generator_obj) 
 +
 +Out ranges::generate_n (Out first, Size n, Func generator_obj) 
 +</code>
 +[[..:lib:generate_n|Beschreibung]]:
 + Füllt in den bei ''first'' beginnenden Bereich ''n'' durch ''generator_obj'' erzeugte Werte.
 +
 +==== Ersetzen ====
 +<code cpp>
 +void replace (For first, For last, T alterwert, T neuerwert) 
 +void replace (Exec pol, For first, For last, T alterwert, T neuerwert) 
 +
 +In ranges::replace (Range r, T alterwert, T neuerwert, Proj proj = {}) 
 +In ranges::replace (In first, In last, T alterwert, T neuerwert, Proj proj = {}) 
 +</code>
 +[[..:lib:replace|Beschreibung]]:
 + Ersetzt im Bereich [first,last) alle Elemente ''e'' mit ''proj(e) == alterwert'' durch ''neuerwert''.
 +
 +<code cpp>
 +void replace_if (For first, For last, Pred pred, T neuerwert) 
 +void replace_if (Exec pol, For first, For last, Pred pred, T neuerwert) 
 +
 +In ranges::replace_if (Range r, Pred pred, T neuerwert, Proj proj = {}) 
 +In ranges::replace_if (For first, For last, Pred pred, T neuerwert, Proj proj = {}) 
 +</code>
 +[[..:lib:replace_if|Beschreibung]]:
 + Ersetzt im Bereich [first,last) all jene Elemente ''e'', auf die ''pred(proj(e))'' zutrifft, durch ''neuerwert''.
 +
 +<code cpp>
 +Out replace_copy (In first, In last, Out result, T alterwert, T neuerwert) 
 +Out replace_copy (Exec pol, In first, In last, Out result, T alterwert, T neuerwert) 
 +
 +[last, out] = ranges::replace_copy (Range r, Out result, T alterwert, T neuerwert, Proj proj = {}) 
 +[last, out] = ranges::replace_copy (In first, In last, Out result, T alterwert, T neuerwert, Proj proj = {}) 
 +</code>
 +[[..:lib:replace_copy|Beschreibung]]:
 + Kopiert den Bereich [first,last) nach [result,...) und ersetzt dabei Elemente mit ''proj(e) == alterwert'' durch ''neuerwert''.
 +
 +<code cpp>
 +Out replace_copy_if (In first, In last, Out result, Pre pred, T neuerwert) 
 +Out replace_copy_if (Exec pol, In first, In last, Out result, Pre pred, T neuerwert) 
 +
 +[last, out] = ranges::replace_copy_if (Range r, Out result, Pre pred, T neuerwert, Proj proj = {}) 
 +[last, out] = ranges::replace_copy_if (In first, In last, Out result, Pre pred, T neuerwert, Proj proj = {}) 
 +</code>
 +[[..:lib:replace_copy_if|Beschreibung]]:
 + Kopiert den Bereich [first,last) nach [result,...) und ersetzt dabei all jene Elemente ''e'', 
 + auf die ''pred(proj(e))'' zutrifft, durch ''neuerwert''.
 +
 +==== Entfernen ====
 +<code cpp>
 +For remove (For first, For last, T wert) 
 +For remove (Exec pol, For first, For last, T wert) 
 +
 +Range ranges::remove (Range r, T wert, Proj proj = {}) 
 +Range ranges::remove (For first, For last, T wert, Proj proj = {}) 
 +</code>
 +[[..:lib:remove|Beschreibung]]:
 + Entfernt im Bereich [first,last) alle Elemente ''e'' mit ''proj(e) == wert''.
 +
 +<code cpp>
 +For remove_if (For first, For last, Pred pred) 
 +For remove_if (Exec pol, For first, For last, Pred pred) 
 +
 +Range ranges::remove_if (Range r, Pred pred, Proj proj = {}) 
 +Range ranges::remove_if (For first, For last, Pred pred, Proj proj = {}) 
 +</code>
 +[[..:lib:remove_if|Beschreibung]]:
 + Entfernt im Bereich [first,last) alle Elemente ''e'', auf die ''pred(proj(e))'' zutrifft.
 +
 +<code cpp>
 +Out remove_copy (In first, In last, Out result, T wert) 
 +Out remove_copy (Exec pol, In first, In last, Out result, T wert) 
 +
 +[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 = {}) 
 +</code>
 +[[..:lib:remove_copy|Beschreibung]]:
 + Kopiert den Bereich [first,last) nach [result,...) 
 + und entfernt dabei alle Elemente ''e'' mit dem angegebenen ''wert'' bzw. 
 + auf die ''pred(proj(e))'' zutrifft.
 +
 +<code cpp>
 +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_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 = {}) 
 +</code>
 +[[..:lib:remove_copy_if|Beschreibung]]:
 + Kopiert den Bereich [first,last) nach [result,...) 
 + und entfernt dabei alle Elemente ''e'' mit dem angegebenen ''wert'' bzw. 
 + auf die ''pred(proj(e))'' zutrifft.
 +
 +<code cpp>
 +For unique (For first, For last) 
 +For unique (For first, For last, Binary pred) 
 +For unique (Exec pol, first, For last) 
 +For unique (Exec pol, For first, For last, Binary pred) 
 +
 +Range ranges::unique (Range r, Binary pred = {}, Proj proj = {}) 
 +Range ranges::unique (For first, For last, Binary pred = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:unique|Beschreibung]]:
 + Entfernt alle Elemente ''e'' aus dem Bereich [first,last), 
 + die mit ihren Vorgänger übereinstimmen bzw. auf die ''pred(proj(vorgaenger),proj(e))'' zutrifft.
 +
 +<code cpp>
 +Out unique_copy (In first, In last, Out result) 
 +Out unique_copy (In first, In last, Out result, Binary pred) 
 +Out unique_copy (Exec pol, In first, In last, Out result) 
 +Out unique_copy (Exec pol, In first, In last, Out result, Binary pred) 
 +
 +[last,res] = ranges::unique_copy (Raneg r, Out result, Binary pred = {}, Proj proj = {}) 
 +[last,res] = ranges::unique_copy (In first, In last, Out result, Binary pred = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:unique_copy|Beschreibung]]:
 + Kopiert den Bereich [first,last) nach [result,...) 
 + und übergeht dabei alle Elemente ''e'' aus dem Bereich [first,last), 
 + die mit ihren Vorgänger übereinstimmen bzw. auf die ''pred(proj(vorgaenger), proj(e))'' zutrifft.
 +
 +==== Umwandeln ====
 +<code cpp>
 +Out transform (In first, In last, Out result, Func func) 
 +Out transform (In first, In last, In first2, Out result, Binary func) 
 +Out transform (Exec pol, In first, In last, Out result, Func func) 
 +Out transform (Exec pol, In first, In last, In first2, Out result, Binary func) 
 +
 +[end,res] = ranges::transform (Range r, Out result, Func func, Proj proj = {}) 
 +[end,res] = ranges::transform (In first, In last, Out result, Func func, Proj proj = {}) 
 +
 +[end1,end2,res] = ranges::transform (Range1 r1, Range2 r2, Out result, Binary func, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +[end1,end2,res] = ranges::transform (In first, In last, In2 first2, In2 last2, Out result, Binary func, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +</code>
 +[[..:lib:transform|Beschreibung]]:
 + Errechnet aus den Elementen ''x'' des Bereiches [first,last) und Elementen ''y'' des Bereiches [first2, last2)
 + eine Folge von Werten ''func(proj(x))'' bzw. 
 + ''func(proj1(x), proj2(y))'' und legt diese im Bereich [result,...) ab. 
 +
 +===== Mutierende Algorithmen =====
 +
 +==== Umkehren ====
 +<code cpp>
 +void reverse (Bi first, Bi last) 
 +void reverse (Exec pol, Bi first, Bi last) 
 +
 +Bi ranges::reverse (Range r) 
 +Bi ranges::reverse (Bi first, Bi last) 
 +</code>
 +[[..:lib:reverse|Beschreibung]]:
 + Kehrt die Reihenfolge des Elemente im Bereich [first,last) um.
 +
 +<code cpp>
 +Out reverse_copy (Bi first, Bi last, Out result) 
 +Out reverse_copy (Exec pol, Bi first, Bi last, Out result)
 +
 +[last,res] = ranges::reverse_copy (Range r, Out result) 
 +[last,res] = ranges::reverse_copy (Bi first, Bi last, Out result) 
 +</code>
 +[[..:lib:reverse_copy|Beschreibung]]:
 + Kopiert den Bereich [first,last) in umgekehrter Reihenfolge nach [result,...).
 +
 +==== Rotieren ====
 +<code cpp>
 +For rotate (For first, For middle, For last) 
 +For rotate (Exec pol, For first, For middle, For last) 
 +
 +Range ranges::rotate (For first, For middle, For last) 
 +</code>
 +[[..:lib:rotate|Beschreibung]]:
 + Vertauscht die Bereiche [first,middle) und [middle,last). 
 +
 +<code cpp>
 +Out rotate_copy (For first, For middle, For last, Out result) 
 +Out rotate_copy (Exec pol, For first, For middle, For last, Out result) 
 +
 +[last,res] = ranges::rotate_copy (Range r, For last, Out result) 
 +[last,res] = ranges::rotate_copy (For first, For middle, For last, Out result) 
 +</code>
 +[[..:lib:rotate_copy|Beschreibung]]:
 + Kopiert die Bereiche [middle,last) und [first,middle) in dieser Reihenfolge nach [result,...).
 +
 +==== Durcheinanderbringen ====
 +<code cpp>
 +void shuffle (Ran first, Ran last, UniformRandomBitGenerator zufall)  // C++11
 +
 +Ran ranges::shuffle (Range r, UniformRandomBitGenerator zufall)
 +Ran ranges::shuffle (Ran first, Ran last, UniformRandomBitGenerator zufall)
 +</code>
 +[[..:lib:shuffle|Beschreibung]]:
 + Ordnet den Bereich [first,last) zufällig um. 
 +
 +<code cpp>
 +Out sample (In first, In last, Out first2, N n, UniformRandomBitGenerator zufall)  // C++17
 +
 +Out ranges::sample (Range r, Out first2, N n, UniformRandomBitGenerator zufall)
 +Out ranges::sample (In first, In last, Out first2, N n, UniformRandomBitGenerator zufall)
 +</code>
 +[[..:lib:sample|Beschreibung]]:
 + Liefert n Werte aus dem Bereich [first,last) in zufälliger Folge. 
 +
 +<code cpp>
 +void random_shuffle (Ran first, Ran last)              // bis C++14, entfernt in C++17 
 +void random_shuffle (Ran first, Ran last, Func zufall) 
 +</code>
 +[[..:lib:random_shuffle|Beschreibung]]:
 + Ordnet den Bereich [first,last) zufällig um. 
 + Der Aufruf zufall(n) sollte Zahlen im Bereich [0,n) liefern.
 +
 +
 +==== Systematisches Umordnen ====
 +<code cpp>
 +bool is_permutation (For first, For last, For2 first2) 
 +bool is_permutation (For first, For last, For2 first2, Binary comp) 
 +bool is_permutation (For first, For last, For2 first2, For2 last2) 
 +bool is_permutation (For first, For last, For2 first2, For2 last2, Binary comp) 
 +
 +bool ranges::is_permutation (Range1 r1, Range2 r2, Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 ={}) 
 +bool ranges::is_permutation (For first, For last, For2 first2, For2 last2, Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 ={}) 
 +</code>
 +[[..:lib:is_permutation|Beschreibung]]:
 + Prüft, ob [first2,...) eine Permutation des Bereiches [first,last) darstellt.
 +
 +<code cpp>
 +bool next_permutation (Bi first, Bi last) 
 +bool next_permutation (Bi first, Bi last, Binary comp) 
 +
 +[last,B] = ranges::next_permutation (Range r, Binary comp = {}, Proj proj = {}) 
 +[last,B] = ranges::next_permutation (Bi first, Bi last, Binary comp = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:next_permutation|Beschreibung]]:
 + Erzeugt die nächste Permutation des Bereiches [first,last).
 +
 +<code cpp>
 +bool prev_permutation (Bi first, Bi last) 
 +bool prev_permutation (Bi first, Bi last, binary comp) 
 +
 +[last,B] = ranges::prev_permutation (Range r, Binary comp = {}, Proj proj = {}) 
 +[last,B] = ranges::prev_permutation (Bi first, Bi last, Binary comp = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:prev_permutation|Beschreibung]]:
 + Erzeugt die vorhergehende Permutation des Bereiches [first,last).
 +
 +==== Links/rechts schieben ====
 +<code cpp>
 +For shift_left (For first, For last, difference_type n);            // C++20
 +For shift_left (Exec pol, For first, For last, difference_type n);
 +</code>
 +[[..:lib:shift_left|Beschreibung]]:
 + Verschiebt die Elemente des Bereichs [first, last) um n Positionen nach links.
 +
 +<code cpp>
 +For shift_right (For first, For last, difference_type n);           // C++20
 +For shift_right (Exec pol, For first, For last, difference_type n);
 +</code>
 +[[..:lib:shift_right|Beschreibung]]:
 + Verschiebt die Elemente des Bereichs [first, last) um n Positionen nach rechts.
 +
 +
 +
 +
 +===== Sortieren =====
 +
 +==== Vollständiges Sortieren ====
 +<code cpp>
 +bool is_sorted (For first, For last) 
 +bool is_sorted (For first, For last, Binary comp) 
 +bool is_sorted (Exec pol, For first, For last) 
 +bool is_sorted (Exec pol, For first, For last, Binary comp) 
 +
 +bool ranges::is_sorted (Range r, Binary comp = {}, Proj proj = {}) 
 +bool ranges::is_sorted (For first, For last, Binary comp = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:is_sorted|Beschreibung]]:
 + Prüft, ob der Bereich [first,last) in aufsteigender Folge sortiert ist.
 +
 +<code cpp>
 +void sort (Ran first, Ran last) 
 +void sort (Ran first, Ran last, Comp comp) 
 +void sort (Exec pol, Ran first, Ran last) 
 +void sort (Exec pol, Ran first, Ran last, Comp comp) 
 +
 +Ran ranges::sort (Range r, Comp comp = {}, Proj proj = {}) 
 +Ran ranges::sort (Ran first, Ran last, Comp comp = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:sort|Beschreibung]]:
 + Sortiert den Bereich [first,last) in aufsteigender Folge.
 +
 +<code cpp>
 +void stable_sort (Ran first, Ran last) 
 +void stable_sort (Ran first, Ran last, Comp comp) 
 +void stable_sort (Exec pol, Ran first, Ran last) 
 +void stable_sort (Exec pol, Ran first, Ran last, Comp comp) 
 +
 +Ran ranges::stable_sort (Range r, Comp comp = {}, Proj proj = {}) 
 +Ran ranges::stable_sort (Ran first, Ran last, Comp comp = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:stable_sort|Beschreibung]]:
 + Sortiert den Bereich [first,last) in aufsteigender Folge.
 + Die relative Anordnung wertgleicher Elemente bleibt erhalten.
 +
 +
 +==== Teilweises Sortieren ====
 +<code cpp>
 +For is_sorted_until (For first, For last) 
 +For is_sorted_until (For first, For last, Binary comp) 
 +For is_sorted_until (Exec pol, For first, For last) 
 +For is_sorted_until (Exec pol, For first, For last, Binary comp) 
 +
 +For ranges::is_sorted_until (Range r, Binary comp = {}, Proj proj = {}) 
 +For ranges::is_sorted_until (For first, For last, Binary comp = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:is_sorted_until|Beschreibung]]:
 + Liefert den Iterator ''i'' auf das Ende des aufsteigend sortierten Teilbereichs [first,i) von [first,last).
 +
 +<code cpp>
 +void partial_sort (Ran first, Ran middle, Ran last) 
 +void partial_sort (Ran first, Ran middle, Ran last, Binary comp) 
 +void partial_sort (Exec pol, Ran first, Ran middle, Ran last) 
 +void partial_sort (Exec pol, Ran first, Ran middle, Ran last, Binary comp) 
 +
 +Ran ranges::partial_sort (Range r, Ran middle, Binary comp = {}, Proj proj = {}) 
 +Ran ranges::partial_sort (Ran first, Ran middle, Ran last, Binary comp = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:partial_sort|Beschreibung]]:
 + Bringt die kleinsten Elemente des Bereiches [first,last) 
 + aufsteigend geordnet im Bereich [first,middle) unter.
 +
 +<code cpp>
 +Ran partial_sort_copy (In first, In last, Ran result_first, Ran result_last) 
 +Ran partial_sort_copy (In first, In last, Ran result_first, Ran result_last, Binary comp) 
 +Ran partial_sort_copy (Exec pol, In first, In last, Ran result_first, Ran result_last) 
 +Ran partial_sort_copy (Exec pol, In first, In last, Ran result_first, Ran result_last, Binary comp) 
 +
 +[last,res] = partial_sort_copy (Range1 r1, Range2 result, Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +[last,res] = partial_sort_copy (In first, In last, Ran result_first, Ran result_last, Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +</code>
 +[[..:lib:partial_sort_copy|Beschreibung]]:
 + Kopiert die kleinsten Elemente des Bereiches [first,last)
 + aufsteigend geordnet in den Bereich [result_first,result_last).
 +
 +<code cpp>
 +void nth_element (Ran first, Ran nth, Ran last) 
 +void nth_element (Ran first, Ran nth, Ran last, Binary comp) 
 +void nth_element (Exec pol, Ran first, Ran nth, Ran last) 
 +void nth_element (Exec pol, Ran first, Ran nth, Ran last, Binary comp) 
 +
 +Ran ranges::nth_element (Range r, Ran nth, Binary comp = {}, Projproj = {}) 
 +Ran ranges::nth_element (Ran first, Ran nth, Ran last, Binary comp = {}, Projproj = {}) 
 +</code>
 +[[..:lib:nth_element|Beschreibung]]:
 + Sortiert den Bereich [first,last) soweit,
 + dass das nte Element an der richtigen Position steht 
 + und sich links davon nur kleinere, rechts davon nur größere Elementwerte befinden.
 +
 +==== Aufteilen ====
 +<code cpp>
 +bool is_partitioned (In first, In last, Pred pred) 
 +bool is_partitioned (Exec pol, In first, In last, Pred pred) 
 +
 +bool ranges::is_partitioned (Range r, Pred pred, Proj proj = {}) 
 +bool ranges::is_partitioned (In first, In last, Pred pred, Proj proj = {}) 
 +</code>
 +[[..:lib:is_partitioned|Beschreibung]]:
 + Prüft, ob im Bereich [first,last) alle Elemente ''e'',
 + auf die ''pred(proj(e))'' zutrifft, links von denen stehen, auf die es nicht zutrifft.
 +
 +<code cpp>
 +For partition (For first, For last, Pred pred) 
 +For partition (Exec pol, For first, For last, Pred pred) 
 +
 +Range range::partition (Range r, Pred pred, Proj proj = {}) 
 +Range range::partition (For first, For last, Pred pred, Proj proj = {}) 
 +</code>
 +[[..:lib:partition|Beschreibung]]:
 + Bringt alle Elemente ''e'' des Bereiches [first,last), 
 + auf die ''pred(proj(e))'' zutrifft, nach links, alle anderen nach rechts.
 +
 +<code cpp>
 +For stable_partition (For first, For last, Pred pred) 
 +For stable_partition (Exec pol, For first, For last, Pred pred) 
 +
 +Range range::stable_partition (Range r, Pred pred, Proj proj = {}) 
 +Range range::stable_partition (For first, For last, Pred pred, Proj proj = {}) 
 +</code>
 +[[..:lib:stable_partition|Beschreibung]]:
 + Bringt alle Elemente ''e'' des Bereiches [first,last), 
 + auf die ''pred(proj(e))'' zutrifft, nach links, alle anderen nach rechts. 
 + Die relative Ordnung der Elemente in beiden Gruppen bleibt erhalten.
 +
 +<code cpp>
 +std:pair<Out, Out2> partition_copy (In first, In last, Out good, Out2 bad, Pred pred) 
 +std:pair<Out, Out2> partition_copy (Exec pol, In first, In last, Out good, Out2 bad, Pred pred) 
 +
 +[last, endgood, endbad] = ranges::partition_copy (Range r, Out good, Out2 bad, Pred pred, Proj proj = {}) 
 +[last, endgood, endbad] = ranges::partition_copy (In first, In last, Out good, Out2 bad, Pred pred, Proj proj = {}) 
 +</code>
 +[[..:lib:partition_copy|Beschreibung]]:
 + Kopiert alle Elemente ''e'' des Bereiches [first,last), 
 + auf die ''pred(proj(e))'' zutrifft, in den durch ''good'' angegebenen Bereich, 
 + alle anderen nach ''bad''.
 +
 +<code cpp>
 +For partition_point (For first, For last, Pred pred) 
 +
 +For ranges::partition_point (Range r, Pred pred, Proj proj = {}) 
 +For ranges::partition_point (For first, For last, Pred pred, Proj proj = {}) 
 +</code>
 +[[..:lib:partition_point|Beschreibung]]:
 + Liefert den Iterator hinter das letzte Element ''e'' 
 + im partitionierten Bereich [first,last), 
 + auf welches ''pred(proj(e))'' zutrifft.
 +
 +==== Mischen ====
 +<code cpp>
 +Out merge (In first, In last, In2 first2, In2 last2, Out result) 
 +Out merge (In first, In last, In2 first2, In2 last2, Out result, Binary comp) 
 +Out merge (Exec pol, In first, In last, In2 first2, In2 last2, Out result) 
 +Out merge (Exec pol, In first, In last, In2 first2, In2 last2, Out result, binary comp) 
 +
 +[last1,last2,res] = ranges::merge (Range1 r1, Range2 r2, Out result, Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +[last1,last2,res] = ranges::merge (In first, In last, In2 first2, In2 last2, Out result, 
 +                                   Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +</code>
 +[[..:lib:merge|Beschreibung]]:
 + Führt zwei aufsteigend sortierte Bereiche [first,last) und [first2,last2)
 + in [result,...) aufsteigend sortiert zusammen. 
 +
 +<code cpp>
 +void inplace_merge (Bi first, Bi middle, Bi last) 
 +void inplace_merge (Bi first, Bi middle, Bi last, Binary comp) 
 +void inplace_merge (Exec pol, Bi first, Bi middle, Bi last) 
 +void inplace_merge (Exec pol, Bi first, Bi middle, Bi last, Binary comp) 
 +
 +Bi ranges::inplace_merge (Range r, Bi middle, Binary comp = {}, Proj proj = {}) 
 +Bi ranges::inplace_merge (Bi first, Bi middle, Bi last, Binary comp = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:inplace_merge|Beschreibung]]:
 + Ordnet die in sich aufsteigend sortierten Bereiche [first,middle) und [middle,last2) so um,
 + dass der gesamte Bereich aufsteigend sortiert ist.
 +
 +==== Mengenoperationen ====
 +<code cpp>
 +bool includes (In first1, In last1, In2 first2, In2 last2) 
 +bool includes (In first1, In last1, In2 first2, In2 last2, Binary comp) 
 +bool includes (Exec pol, In first1, In last1, In2 first2, In2 last2) 
 +bool includes (Exec pol, In first1, In last1, In2 first2, In2 last2, Binary comp) 
 +
 +bool ranges::includes (Range1 r1, Range2 r2, Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +bool ranges::includes (In first1, In last1, In2 first2, In2 last2, Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +</code>
 +[[..:lib:includes|Beschreibung]]:
 + Ist ''true'', wenn jedes Element des aufsteigend sortierten Bereiches [first2,last2)
 + im aufsteigend sortierten Bereich [first,last) enthalten ist.
 +
 +<code cpp>
 +Out set_union (In first1, In last1, In2 first2, In2 last2, Out result) 
 +Out set_union (In first1, In last1, In2 first2, In2 last2, Out result, Binary comp) 
 +Out set_union (Exec pol, In first1, In last1, In2 first2, In2 last2, Out result) 
 +Out set_union (Exec pol, In first1, In last1, In2 first2, In2 last2, Out result, Binary comp) 
 +
 +[last1,last2,res] = ranges::set_union (Range1 r1, Range2 r2, Out result, 
 +                                       Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +[last1,last2,res] = ranges::set_union (In first1, In last1, In2 first2, In2 last2, Out result, 
 +                                       Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +</code>
 +[[..:lib:set_union|Beschreibung]]:
 + Schreibt die Vereinigung der beiden sortierten Mengen [first,last) und [first2,last2)
 + sortiert in den Bereich [result,...).
 +
 +<code cpp>
 +Out set_intersection (In first1, In last1, In2 first2, In2 last2, Out result) 
 +Out set_intersection (In first1, In last1, In2 first2, In2 last2, Out result, Binary comp) 
 +Out set_intersection (Exec pol, In first1, In last1, In2 first2, In2 last2, Out result) 
 +Out set_intersection (Exec pol, In first1, In last1, In2 first2, In2 last2, Out result, Binary comp) 
 +
 +[last1,last2,res] = ranges::set_intersection (Range1 r1, Range2 r2, Out result, 
 +                                              Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +[last1,last2,res] = ranges::set_intersection (In first1, In last1, In2 first2, In2 last2, Out result, 
 +                                              Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +</code>
 +[[..:lib:set_intersection|Beschreibung]]:
 + Schreibt den Durchschnitt der beiden sortierten Mengen [first,last) und [first2,last2)
 + sortiert in den Bereich [result,...).
 +
 +<code cpp>
 +Out set_difference (In first1, In last1, In2 first2, In2 last2, Out result) 
 +Out set_difference (In first1, In last1, In2 first2, In2 last2, Out result, Binary comp) 
 +Out set_difference (Exec pol, In first1, In last1, In2 first2, In2 last2, Out result) 
 +Out set_difference (Exec pol, In first1, In last1, In2 first2, In2 last2, Out result, Binary comp) 
 +
 +[last1,res] = ranges::set_difference (Range1 r1, Range2 r2, Out result, 
 +                                      Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +[last1,res] = ranges::set_difference (In first1, In last1, In2 first2, In2 last2, Out result, 
 +                                      Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +</code>
 +[[..:lib:set_difference|Beschreibung]]:
 + Kopiert jene Elemente des sortierten Bereichs [first,last),
 + die nicht in [first2,last2) vorkommen, sortiert in den Bereich [result,...).
 +
 +<code cpp>
 +Out set_symmetric_difference (In first1, In last1, In2 first2, In2 last2, Out result) 
 +Out set_symmetric_difference (In first1, In last1, In2 first2, In2 last2, Out result, Binary comp) 
 +Out set_symmetric_difference (Exec pol, In first1, In last1, In2 first2, In2 last2, Out result) 
 +Out set_symmetric_difference (Exec pol, In first1, In last1, In2 first2, In2 last2, Out result, Binary comp) 
 +
 +[last1,res] = ranges::set_symmetric_difference (Range1 r1, Range2 r2, Out result, 
 +                                                Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +[last1,res] = ranges::set_symmetric_difference (In first1, In last1, In2 first2, In2 last2, Out result, 
 +                                                Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) 
 +</code>
 +[[..:lib:set_symmetric_difference|Beschreibung]]:
 + Kopiert jene Elemente,
 + die nur in einem der beiden sortierten Bereiche [first,last) und [first2,last2) vorkommen,
 + sortiert in den Bereich [result,...).
 +
 +==== Heapoperationen ====
 +<code cpp>
 +bool is_heap (Ran first, Ran last) 
 +bool is_heap (Ran first, Ran last, Binary comp) 
 +
 +bool is_heap (Exec pol, Ran first, Ran last) 
 +bool is_heap (Exec pol, Ran first, Ran last, Binary comp) 
 +
 +bool ranges::is_heap (Range r, Binary comp = {}, Proj proj = {}) 
 +bool ranges::is_heap (Ran first, Ran last, Binary comp = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:is_heap|Beschreibung]]:
 + Prüft, ob der Bereich [first,last) als [[..:begriffe#Heap]] geordnet ist.
 +
 +<code cpp>
 +Ran is_heap_until (Ran first, Ran last) 
 +Ran is_heap_until (Ran first, Ran last, Binary comp) 
 +Ran is_heap_until (Exec pol, Ran first, Ran last) 
 +Ran is_heap_until (Exec pol, Ran first, Ran last, Binary comp) 
 +
 +Ran ranges::is_heap_until (Range r, Binary comp = {}, Proj proj = {}) 
 +Ran ranges::is_heap_until (Ran first, Ran last, Binary comp = {}, Proj proj = {}) 
 +</code>
 +[[..:lib:is_heap_until|Beschreibung]]:
 + Liefert den Iterator auf das Ende des als [[..:begriffe#Heap]] geordneten Teilbereiches von [first,last).
 +
 +<code cpp>
 +void push_heap (Ran first, Ran last) 
 +void push_heap (Ran first, Ran last, Binary comp) 
 +
 +Ran ranges::push_heap (Range r, Binary comp = {}, proj = {}) 
 +Ran ranges::push_heap (Ran first, Ran last, Binary comp = {}, proj = {}) 
 +</code>
 +[[..:lib:push_heap|Beschreibung]]:
 + Fügt das letzte Element des Bereiches [first,last) in den davor liegenden, als [[..:begriffe#Heap]] geordneten Bereich ein.
 +
 +<code cpp>
 +void pop_heap (Ran first, Ran last) 
 +void pop_heap (Ran first, Ran last, Binary comp) 
 +
 +Ran ranges::pop_heap (Range r, Binary comp = {}, proj = {}) 
 +Ran ranges::pop_heap (Ran first, Ran last, Binary comp = {}, proj = {}) 
 +</code>
 +[[..:lib:pop_heap|Beschreibung]]:
 + Vertauscht ''*first'' und ''*(last-1)'' des als [[..:begriffe#Heap]] geordneten Bereiches [first,last) und ordnet den vor dem letzten Element liegenden Teilbereich wieder zu einem Heap um.
 +
 +<code cpp>
 +void make_heap (Ran first, Ran last) 
 +void make_heap (Ran first, Ran last, Binary comp) 
 +
 +Ran ranges::make_heap (Range r, Binary comp = {}, proj = {}) 
 +Ran ranges::make_heap (Ran first, Ran last, Binary comp = {}, proj = {}) 
 +</code>
 +[[..:lib:make_heap|Beschreibung]]:
 + Ordnet den Bereich [first,last) zu einem [[..:begriffe#Heap]] um.
 +
 +<code cpp>
 +void sort_heap (Ran first, Ran last) 
 +void sort_heap (Ran first, Ran last, Binary comp) 
 +
 +Ran ranges::sort_heap (Range r, Binary comp = {}, proj = {}) 
 +Ran ranges::sort_heap (Ran first, Ran last, Binary comp = {}, proj = {}) 
 +</code>
 +[[..:lib:sort_heap|Beschreibung]]:
 + Sortiert den als [[..:begriffe#Heap]] vorgegebenen Bereich [first,last) aufsteigend.
 +
 +==== Siehe auch ====
 +[[numeric]]
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki