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 modèle génériqueOriginal: 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 spécialisation 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 spécialisation 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 méthode
get attend que le shared_future a un résultat valable et (en fonction du modèle utilisé), il récupère. Il appelle effectivement wait() pour attendre le résultat .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 modèle générique et deux spécialisations modèles contiennent chacune une seule version de
get. Les trois versions de get ne diffèrent 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 après un appel à cette méthode .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.
Paramètres
(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 stockée dans l'état partagé. Si elle satisfait aux exigences de
MoveAssignable, la valeur est déplacé, 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 référence à 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é référencé par l'avenir (par exemple, via un appel à
std::promise::set_exception) alors que exception sera levée .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
vérifie 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) | |