名前空間
変種
操作

std::future::get

提供: cppreference.com
< cpp‎ | thread‎ | future

 
 
スレッドのサポートライブラリ
スレッド
Original:
Threads
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
thread(C++11)
this_thread空間
Original:
this_thread namespace
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
get_id(C++11)
yield(C++11)
sleep_for(C++11)
sleep_until(C++11)
相互排除
Original:
Mutual exclusion
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
mutex(C++11)
timed_mutex(C++11)
汎用のロック管理
Original:
Generic lock management
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
lock_guard(C++11)
unique_lock(C++11)
defer_lock_t
try_to_lock_t
adopt_lock_t
(C++11)
(C++11)
(C++11)
lock(C++11)
try_lock(C++11)
defer_lock
try_to_lock
adopt_lock
(C++11)
(C++11)
(C++11)
条件変数
Original:
Condition variables
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
condition_variable(C++11)
condition_variable_any(C++11)
notify_all_at_thread_exit(C++11)
cv_status(C++11)
先物
Original:
Futures
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
promise(C++11)
future(C++11)
shared_future(C++11)
packaged_task(C++11)
async(C++11)
launch(C++11)
future_status(C++11)
future_error(C++11)
future_category(C++11)
future_errc(C++11)
 
std::future
future::future
future::~future
future::operator=
future::share
結果を取得する
Original:
Getting the result
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
future::get
状態
Original:
State
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
future::valid
future::wait
future::wait_for
future::wait_until
 
T get();
(1) (唯一のジェネリックfutureテンプレートのメンバー)
(C++11およびそれ以降)
T& get();
(2) (のみfuture<T&>テンプレートの特殊化のメンバー)
(C++11およびそれ以降)
void get();
(3) (のみfuture<void>テンプレートの特殊化のメンバー)
(C++11およびそれ以降)
getが有効な結果を持っており、(使用されているテンプレートに応じて)、それを取得するまでfutureメソッドは待機します。それは効果的に結果を待つためにwait()呼び出し.
Original:
The get method waits until the 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.
汎用テンプレートと2テンプレートの特殊化は、各getの単一のバージョンが含まれています。 getの3つのバージョンでは、戻り値の型が異なるだけで.
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.
valid() == falseこのメソッドを呼び出した後.
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.

目次

[編集] パラメータ

(なし)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

1)
共有状態に格納された値。それはMoveAssignableの要件を満たしている場合は、値が移動され、それ以外の場合はコピーされます.
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.
2)
共有状態の値への参照.
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.
3)
何.
Original:
Nothing.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 例外

例外は将来(std::promise::set_exceptionへの呼び出し経由など)によって参照される共有状態に格納されていた場合は、その例外がスローされます.
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.

[編集]

[編集] も参照してください

将来は約束で状態を共有しているかどうかをチェックします
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.

(パブリックメンバ関数) [edit]