namespace cpp {}

C++ lernen, kennen, anwenden

Benutzer-Werkzeuge

Webseiten-Werkzeuge


kennen:lib:is_partitioned

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.


kennen:lib:is_partitioned [2020-06-16 16:47] (aktuell) – angelegt - Externe Bearbeitung 127.0.0.1
Zeile 1: Zeile 1:
 +====== is_partitioned() ======
 +''#include'' [[..:include:algorithm]]
 +
 +<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>
 + Prüft, ob im Bereich [first,last) alle Elemente ''e'',
 + auf die ''pred(e)'' zutrifft, links von denen stehen, auf die es nicht zutrifft.
 + 
 + ==== Parameter ====
 +| ''first'' | Anfang des Bereiches |
 +| ''last''  | Ende des Bereiches |
 +| ''pred''  | Prädikat |
 +| ''proj''  | einstelliger Funktor (Vorgabe = ''std::identity'') |
 +| ''pol''   | [[..:include:execution|parallele Ausführungsart]] |
 +
 +==== Ergebnis ====
 +Rückgabewert: ''true'', falls der Bereich bezüglich des Prädikats aufgeteilt ist.
 +
 +==== Siehe auch ====
 +[[partition]],
 +[[partition_point]],
 +[[stable_partition]].
 +
 +==== Beispiel ====
 +<code cpp is_partitioned.cpp>
 +#include <algorithm>
 +#include <iostream>
 +#include <string>
 +
 +int main()
 +{
 +  std::string s = "HALLO, Welt";
 +  bool b = std::is_partitioned(begin(s), end(s), [](char c) {return c <= 'Z';});
 +  std::cout << s << " : " << b << '\n';
 +}
 +</code>
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki