namespace cpp {}

C++ lernen, kennen, anwenden

Benutzer-Werkzeuge

Webseiten-Werkzeuge


kennen:lib:is_sorted_until

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.


kennen:lib:is_sorted_until [2020-06-16 16:40] (aktuell) – angelegt - Externe Bearbeitung 127.0.0.1
Zeile 1: Zeile 1:
 +====== is_sorted_until() ======
 +''#include'' [[..:include:algorithm]]
 +
 +<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>
 + Liefert den Iterator ''i'' 
 + auf das Ende des aufsteigend sortierten Teilbereichs [first,i) von [first,last).
 +
 + ==== 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: ''last'', falls ''distance(first,last) < 2'',
 + sonst letzten Iterator ''%%i <= last%%'', 
 + für den ''std::is_sorted(first,i) == true''.
 +
 +==== Siehe auch ====
 +[[is_sorted]],
 +[[partial_sort]],
 +[[sort]].
 +
 +==== Beispiel ====
 +<code cpp is_sorted_until.cpp>
 +#include <algorithm>
 +#include <iostream>
 +#include <string>
 +
 +int main()
 +{
 +  std::string s = "Hallo, Welt";
 +  std::string t(begin(s), std::is_sorted_until(begin(s), end(s)));
 +
 +  std::cout << s << " : " << t << '\n';
 +}
 +</code>
  
kennen/lib/is_sorted_until.txt · Zuletzt geändert: 2020-06-16 16:40 von 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki