namespace std::execution {
template<class Token>
concept scope_token =
copyable<Token> &&
requires(const Token token) {
{ token.try_associate() } -> same_as<bool>;
{ token.disassociate() } noexcept -> same_as<void>;
{ token.wrap(declval<test-sender>()) } -> sender_in<test-env>;
};
}
概要
scope_tokenコンセプトは、Senderと非同期スコープ間の関連付けを作成するために利用できる型Tokenに対する要件を定義する。
test-senderとtest-envは、sender_in<test-sender, test-env>のモデルである未規定の型とする。
モデル
型Tokenは、次のときscope_tokenのモデルとなる。
Token型オブジェクトのコピー構築、ムーブ構築、コピー代入、ムーブ代入から例外送出しない、かつ- (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++: ??