#include
<algorithm>
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 = {})
Ist wahr, wenn die Bereiche [first,last) und [first2,…) elementweise übereinstimmen bzw. paarweise das Prädikat pred(proj1(x),proj2(y))
erfüllen.
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 | parallele Ausführungsart |
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.
#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'; }