namespace cpp {}

C++ lernen, kennen, anwenden

Benutzer-Werkzeuge

Webseiten-Werkzeuge


kennen:lib:is_permutation

is_permutation()

#include <algorithm>

bool is_permutation (For first, For last, For2 first2) 
bool is_permutation (For first, For last, For2 first2, Binary comp) 
bool is_permutation (For first, For last, For2 first2, For2 last2) 
bool is_permutation (For first, For last, For2 first2, For2 last2, Binary comp) 
 
bool ranges::is_permutation (Range1 r1, Range2 r2, Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 ={}) 
bool ranges::is_permutation (For first, For last, For2 first2, For2 last2, Binary comp = {}, Proj1 proj1 = {}, Proj2 proj2 ={}) 

Prüft, ob [first2,…) eine Permutation des Bereiches [first,last) darstellt.

Parameter

first Anfang des Bereiches
last Ende des Bereiches
first2 Anfang des anderen Bereiches
last2 Ende des anderen Bereiches
comp Vergleichskriterium (Vorgabe = less)
proj einstelliger Funktor (Vorgabe = std::identity)

Ergebnis

Rückgabewert: true, falls die Bereiche durch Permutation ineinander überführbar sind.

Siehe auch

Beispiel

is_parmutation.cpp
#include <algorithm>
#include <iostream>
#include <string>
 
int main()
{
  std::string s = "THELAW", s2 = "WEALTH";
  std::cout << s << " ./. " << s2 << " : " 
            << std::is_permutation(begin(s), end(s), begin(s2)) << '\n';
}
kennen/lib/is_permutation.txt · Zuletzt geändert: 2020-06-16 15:56 von 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki