kennen:lib:async
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
— | kennen:lib:async [2019-11-20 15:00] (aktuell) – angelegt - Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== async() ====== | ||
+ | ''# | ||
+ | |||
+ | <code cpp> | ||
+ | template <class F, class... Args> | ||
+ | future< | ||
+ | template <class F, class... Args> | ||
+ | future< | ||
+ | </ | ||
+ | | ||
+ | |||
+ | ==== Parameter ==== | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | |||
+ | Als Startverhalten können '' | ||
+ | |||
+ | ==== Ergebnis ==== | ||
+ | Rückgabewert: | ||
+ | |||
+ | ==== Siehe auch ==== | ||
+ | [[ref|cref()]], | ||
+ | [[ref]], | ||
+ | [[..: | ||
+ | |||
+ | ==== Beispiel ==== | ||
+ | <code cpp async.cpp> | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | int countdown(std:: | ||
+ | { | ||
+ | int done = 0, nr; | ||
+ | while ( (nr = int(--jobs)) >= 0) ++done; | ||
+ | return done; | ||
+ | } | ||
+ | |||
+ | int main() | ||
+ | { | ||
+ | int n = 1000000; | ||
+ | std:: | ||
+ | auto mode = std:: | ||
+ | auto cnt1 = std:: | ||
+ | auto cnt2 = std:: | ||
+ | int a = cnt1.get(), b = cnt2.get(); | ||
+ | |||
+ | std::cout << a << " + " << b << " = " << a+b << ' | ||
+ | assert(a+b == n); | ||
+ | } | ||
+ | </ | ||
kennen/lib/async.txt · Zuletzt geändert: 2019-11-20 15:00 von 127.0.0.1