33
Execution control library
[exec]
33.14
Execution scope utilities
[exec.scope]
33.14.1
Execution scope concepts
[exec.scope.concepts]
1
#
The
scope_
token
concept defines the requirements on a type
Token
that can be used to create associations between senders and an async scope
.
2
#
Let
test-sender
and
test-env
be unspecified types such that
sender_
in
<
test-sender
,
test-env
>
is modeled
.
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
>
;
}
;
}
3
#
A type
Token
models
scope_
token
only if:
(3.1)
no exceptions are thrown from copy construction, move construction, copy assignment, or move assignment of objects of type
Token
; and
(3.2)
given an lvalue
token
of type (possibly const)
Token
, for all expressions
sndr
such that
decltype
(
(
sndr
)
)
models
sender
:
(3.2.1)
token
.
wrap
(
sndr
)
is a valid expression,
(3.2.2)
decltype
(
token
.
wrap
(
sndr
)
)
models
sender
, and
(3.2.3)
completion_
signatures_
of_
t
<
decltype
(
token
.
wrap
(
sndr
)
)
, E
>
contains the same completion signatures as
completion_
signatures_
of_
t
<
decltype
(
(
sndr
)
)
, E
>
for all types
E
such that
sender_
in
<
decltype
(
(
sndr
)
)
, E
>
is modeled.