Skip to content

Commit 77cf6ea

Browse files
committed
add explicit opt-in for operation_state concept
1 parent d79d8da commit 77cf6ea

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

execution.bs

+16
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ struct operation_base : WSAOVERALAPPED {
427427

428428
template<typename Receiver>
429429
struct recv_op : operation_base {
430+
using operation_state_concept = std::execution::operation_state_t;
431+
430432
recv_op(SOCKET s, void* data, size_t len, Receiver r)
431433
: receiver(std::move(r))
432434
, sock(s) {
@@ -772,6 +774,7 @@ struct _retry_receiver
772774
// re-construct and re-start it if the operation fails.
773775
template<class S, class R>
774776
struct _retry_op {
777+
using operation_state_concept = stdexec::operation_state_t;
775778
using _child_op_t =
776779
stdexec::connect_result_t<S&, _retry_receiver<S, R>>;
777780

@@ -899,7 +902,9 @@ namespace stdexec = std::execution;
899902
class inline_scheduler {
900903
template <class R>
901904
struct _op {
905+
using operation_state_concept = operation_state_t;
902906
R rec_;
907+
903908
void start() & noexcept {
904909
stdexec::set_value(std::move(rec_));
905910
}
@@ -4871,6 +4876,8 @@ namespace std::execution {
48714876
inline constexpr set_stopped_t set_stopped{};
48724877

48734878
// [exec.opstate], operation states
4879+
struct operation_state_t {};
4880+
48744881
template&lt;class O>
48754882
concept operation_state = <i>see below</i>;
48764883

@@ -5456,8 +5463,15 @@ enum class forward_progress_guarantee {
54565463
type ([async.ops]).
54575464

54585465
<pre highlight="c++">
5466+
template&lt;class Rcvr>
5467+
concept <i>enable-opstate</i> = // exposition only
5468+
requires {
5469+
requires derived_from&lt;typename Rcvr::operation_state_concept, operation_state_t>;
5470+
};
5471+
54595472
template&lt;class O>
54605473
concept operation_state =
5474+
<i>enable-opstate</i>&lt;remove_cvref_t&lt;O>> &&
54615475
queryable&lt;O> &&
54625476
is_object_v&lt;O> &&
54635477
requires (O& o) {
@@ -5815,6 +5829,7 @@ enum class forward_progress_guarantee {
58155829
requires <i>well-formed</i>&lt;<i>state-type</i>, Sndr, Rcvr> &&
58165830
<i>well-formed</i>&lt;<i>inner-ops-tuple</i>, Sndr, Rcvr>
58175831
struct <i>basic-operation</i> { // exposition only
5832+
using operation_state_concept = operation_state_t;
58185833
using <i>tag-type</i> = tag_of_t&lt;Sndr>; // exposition only
58195834

58205835
Rcvr rcvr_; // exposition only
@@ -6378,6 +6393,7 @@ template&lt;class Domain, class Tag, sender Sndr, class... Args>
63786393

63796394
<pre highlight="c++">
63806395
struct <i>operation-state-task</i> {
6396+
using operation_state_concept = operation_state_t;
63816397
using promise_type = <i>connect-awaitable-promise</i>;
63826398
coroutine_handle<> <i>coro</i>; <i>// exposition only</i>
63836399

0 commit comments

Comments
 (0)