namespace cpp {}

C++ lernen, kennen, anwenden

Benutzer-Werkzeuge

Webseiten-Werkzeuge


kennen:lib:is_permutation

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.


kennen:lib:is_permutation [2020-06-16 15:56] (aktuell) – angelegt - Externe Bearbeitung 127.0.0.1
Zeile 1: Zeile 1:
 +====== is_permutation() ======
 +''#include'' [[..:include:algorithm]]
 +
 +<code cpp>
 +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 ={}) 
 +</code>
 +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 ====
 +[[next_permutation]],
 +[[prev_permutation]].
 +
 +==== Beispiel ====
 +<code cpp 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';
 +}
 +</code>
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki