std::packaged_task::operator()
Aus cppreference.com
< cpp | thread | packaged task
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
void operator()( ArgTypes... args ); |
(seit C++11) | |
Calls the stored task with args
as the arguments. The return value of the task or any exceptions thrown are stored in the shared state. The shared state is made ready and any threads waiting for this are unblocked.
Inhaltsverzeichnis |
[Bearbeiten] Parameter
args | - | die Parameter beim Aufruf der gespeicherten Aufgabe passieren
Original: the parameters to pass on invocation of the stored task The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[Bearbeiten] Rückgabewert
(None)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[Bearbeiten] Ausnahmen
std::future_error auf den folgenden Fehler:
Original:
std::future_error on the following error conditions:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
- Die gespeicherte Aufgabe wurde bereits aufgerufen. Der Fehler Kategorie wird promise_already_satisfied gesetzt .Original:The stored task has already been invoked. The error category is set to promise_already_satisfied.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - *this hat keinen gemeinsamen Staat. Der Fehler Kategorie wird no_state gesetzt .Original:*this has no shared state. The error category is set to no_state.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[Bearbeiten] Notes
A successful call to opetator()
synchronizes with a call to any member function of a std::future or std::shared_future that share their shared state with *this.
[Bearbeiten] Beispiel
This section is incomplete Reason: no example |
[Bearbeiten] Siehe auch
führt die Funktion sicherzustellen, dass das Ergebnis fertig ist erst einmal die aktuelle Thread beendet Original: executes the function ensuring that the result is ready only once the current thread exits The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) |