namespace cpp {}

C++ lernen, kennen, anwenden

Benutzer-Werkzeuge

Webseiten-Werkzeuge


kennen:lib:stable_sort

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.


kennen:lib:stable_sort [2020-06-14 18:24] (aktuell) – angelegt - Externe Bearbeitung 127.0.0.1
Zeile 1: Zeile 1:
 +====== stable_sort() ======
 +''#include'' [[..:include:algorithm]]
 +
 +<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>
 + Sortiert den Bereich [first,last) in aufsteigender Folge. 
 + Die relative Anordnung wertgleicher Elemente bleibt erhalten.
 +
 +==== Parameter ====
 +| ''first'' | Anfang des Bereiches |
 +| ''last''  | Ende des Bereiches |
 +| ''comp''  | Vergleichskriterium (Vorgabe = ''less'')|
 +| ''proj''  | einstelliger Funktor (Vorgabe = ''std::identity'') |
 +| ''pol''   | [[..:include:execution|parallele Ausführungsart]] |
 +==== Ergebnis ====
 +Rückgabewert: keiner bzw. ''last''
 +==== Siehe auch ====
 +[[is_sorted]],
 +[[sort]],
 +[[stable_partition]].
 +
 +==== Beispiel ====
 +<code cpp stable_sort.cpp>
 +#include <algorithm>
 +#include <iostream>
 +#include <string>
 +
 +int main()
 +{
 +  std::string s = "ein Beispiel";
 +  std::cout << p << '\n';
 +
 +  std::stable_sort(begin(s), end(s));
 +
 +  std::cout << s << '\n';
 +}
 +</code>
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki