namespace std::execution {
template<class Token>
concept scope_token =
copyable<Token> &&
requires(const Token token) {
{ token.try_associate() } -> scope_association;
{ token.wrap(declval<test-sender>()) } -> sender_in<test-env>;
};
}
概要
scope_tokenコンセプトは、Senderと非同期スコープ間の関連付けを作成するために利用できる型Tokenに対する要件を定義する。
Token型の各オブジェクトは、関連スコープと呼ばれる非同期スコープに関連付けられる。
test-senderとtest-envは、sender_in<test-sender, test-env>のモデルである未規定の型とする。
モデル
型Tokenは、次のときscope_tokenのモデルとなる。
Token型オブジェクトのコピー構築、ムーブ構築、コピー代入、ムーブ代入から例外送出しない、かつToken型のオブジェクトtokenに対して、token.try_associate()は有効でない(not engaged)オブジェクト、もしくはtokenの関連スコープとの新しい関連付けを取得して関連付けを所有する有効な(engaged)オブジェクトのいずれかを返す。- (const修飾の可能性のある)型
Tokenの左辺値tokenが与えられたとき、型decltype((sndr))がsenderのモデルである全ての式sndrに対して、token.warp(sndr)が有効な式、かつdecltype(token.warp(sndr))はsenderのモデルであり、かつsender_in<decltype((sndr)), E>のモデルである全てのE型に対して、completion_signatures_of_t<decltype(token.wrap(sndr)), E>はcompletion_signatures_of_t<decltype((sndr)), E>と同一の完了シグネチャを含むこと。
例
#include <execution>
namespace ex = std::execution;
int main()
{
ex::counting_scope scope;
ex::scope_token auto token = scope.get_token();
}
出力
バージョン
言語
- C++26
処理系
- Clang: ??
- GCC: ??
- ICC: ??
- Visual C++: ??