kennen:include:algorithm
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| kennen:include:algorithm [2020-10-25 10:33] – angelegt - Externe Bearbeitung 127.0.0.1 | kennen:include:algorithm [2023-10-14 12:24] (aktuell) – [<algorithm>] rrichter | ||
|---|---|---|---|
| Zeile 19: | Zeile 19: | ||
| Als '' | Als '' | ||
| Projektionen '' | Projektionen '' | ||
| - | Steht an Stelle eines Ergebnistyps '' | + | Steht an Stelle eines Ergebnistyps '' |
| <code cpp> | <code cpp> | ||
| auto [x,y] = f(...); | auto [x,y] = f(...); | ||
| + | |||
| + | auto result = f(...); | ||
| + | std::cout << result.name1 << ' ' << result.name2; | ||
| </ | </ | ||
| + | Alternativ kann auf die Bestandteile der Rückgabestruktur per Namen zugegriffen werden. | ||
| + | Dazu muss man allerdings deren Namen kennen. | ||
| + | Diese werden in der Beschreibung der Algorithmen aufgeführt. | ||
| + | |||
| ===== Nichtmodifizierende Algorithmen ===== | ===== Nichtmodifizierende Algorithmen ===== | ||
| ==== Ausführen und Zählen ==== | ==== Ausführen und Zählen ==== | ||
| Zeile 550: | Zeile 557: | ||
| Out remove_copy (In first, In last, Out result, T wert) | Out remove_copy (In first, In last, Out result, T wert) | ||
| Out remove_copy (Exec pol, In first, In last, Out result, T wert) | Out remove_copy (Exec pol, In first, In last, Out result, T wert) | ||
| - | |||
| - | Out remove_copy_if (In first, In last, Out result, Pred pred) | ||
| - | Out remove_copy_if (Exec pol, In first, In last, Out result, Pred pred) | ||
| [last, res] = ranges:: | [last, res] = ranges:: | ||
| [last, res] = ranges:: | [last, res] = ranges:: | ||
| + | </ | ||
| + | [[..: | ||
| + | | ||
| + | und entfernt dabei alle Elemente '' | ||
| + | auf die '' | ||
| + | |||
| + | <code cpp> | ||
| + | Out remove_copy_if (In first, In last, Out result, Pred pred) | ||
| + | Out remove_copy_if (Exec pol, In first, In last, Out result, Pred pred) | ||
| [last, res] = ranges:: | [last, res] = ranges:: | ||
| [last, res] = ranges:: | [last, res] = ranges:: | ||
| </ | </ | ||
| - | [[..:lib:remove_copy|Beschreibung]]: | + | [[..:lib:remove_copy_if|Beschreibung]]: |
| | | ||
| und entfernt dabei alle Elemente '' | und entfernt dabei alle Elemente '' | ||
kennen/include/algorithm.1603618414.txt.gz · Zuletzt geändert: von 127.0.0.1
