std::shared_future::get
De cppreference.com
[] |
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. |
<metanoindex/>
<tbody> </tbody> T get() const; |
(1) | ( seul membre de )shared_future modle gnriqueOriginal: member only of generic shared_future templateThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (depuis C++11) |
T& get() const; |
(2) | ( seul membre de spcialisation de template )shared_future<T&>Original: member only of shared_future<T&> template specializationThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (depuis C++11) |
void get() const; |
(3) | ( seul membre de spcialisation de template )shared_future<void>Original: member only of shared_future<void> template specializationThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (depuis C++11) |
La mthode
get attend que le shared_future a un rsultat valable et (en fonction du modle utilis), il rcupre. Il appelle effectivement wait() pour attendre le rsultat .Original:
The
get method waits until the shared_future has a valid result and (depending on which template is used) retrieves it. It effectively calls wait() in order to wait for the result.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.
Le modle gnrique et deux spcialisations modles contiennent chacune une seule version de
get. Les trois versions de get ne diffrent que par le type de retour .Original:
The generic template and two template specializations each contain a single version of
get. The three versions of get differ only in the return type.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.
valid() == false aprs un appel cette mthode .Original:
valid() == false after a call to this method.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.
Paramtres
(Aucun)
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.
Retourne la valeur
1)
La valeur stocke dans l'tat partag. Si elle satisfait aux exigences de
MoveAssignable, la valeur est dplac, sinon il est copi .Original:
The value stored in the shared state. If it satisfies the requirements of
MoveAssignable, the value is moved, otherwise it is copied.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.
2)
La rfrence la valeur dans l'tat partag .
Original:
Reference to the value in the shared state.
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.
3)
Rien .
Original:
Nothing.
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.
Exceptions
Si une exception a t stock l'tat partag rfrenc par l'avenir (par exemple, via un appel
std::promise::set_exception) alors que exception sera leve .Original:
If an exception was stored in the shared state referenced by the future (e.g. via a call to
std::promise::set_exception) then that exception will be thrown.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.
Exemple
| This section is incomplete Reason: no example |
Voir aussi
vrifie si le future est un tat partag avec un promise Original: checks if the future has shared state with a promise The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction membre publique) | |