namespace cpp {}

C++ lernen, kennen, anwenden

Benutzer-Werkzeuge

Webseiten-Werkzeuge


kennen:lib:equal

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.


kennen:lib:equal [2020-06-14 17:39] (aktuell) – angelegt - Externe Bearbeitung 127.0.0.1
Zeile 1: Zeile 1:
 +====== equal() ======
 +''#include'' [[..:include:algorithm]]
 +
 +<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 = {}, Pred1 pred1 = {}, Pred2 pred2 = {}) 
 +bool ranges::equal (For first, For last, For2 first2, For2 last2, Binary pred = {}, Pred1 pred1 = {}, Pred2 pred2 = {}) 
 +</code>
 + Ist wahr, wenn die Bereiche [first,last) und [first2,...) elementweise übereinstimmen bzw. paarweise das Prädikat ''pred(proj1(x),proj2(y))'' erfüllen.
 +
 +==== Parameter ====
 +| ''first''  | Anfang eines Bereiches |
 +| ''last''   | Ende eines Bereiches |
 +| ''first2'' | Anfang des zweiten Bereiches |
 +| ''last2''  | Ende des zweiten Bereiches |
 +| ''pred''  | zweistelliges Prädikat (Vorgabe = ''equal_to'')|
 +| ''proj1'', ''proj2''  | einstelliger Funktor (Vorgabe = ''std::identity'') |
 +| ''pol''   | [[..:include:execution|parallele Ausführungsart]] |
 +==== Ergebnis ====
 +Rückgabewert: ''true'', 
 +wenn für jeden Iterator ''i'' im Bereich [first, last)
 +''*i == *(first2 + (i-first))'' gilt bzw.
 +''pred(proj1(*i), proj2(*(first2 + (i-first)))'' zutrifft.
 +
 +==== Siehe auch ====
 +[[mismatch]].
 +
 +==== Beispiel ====
 +<code cpp equal.cpp>
 +#include <algorithm>
 +#include <iostream>
 +
 +int main()
 +{
 +  const char* str = "Doppelmoppel";
 +
 +  std::cout << str << '\n'
 +            << str+6 << '\n'
 +            << std::equal( str+1, str+6, str+8 ) << '\n';
 +}
 +</code>
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki