Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions include/stdexec/execution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,8 @@ namespace stdexec {
struct start_t {
template <class _Op>
requires tag_invocable<start_t, _Op&>
void operator()(_Op& __op) const noexcept(nothrow_tag_invocable<start_t, _Op&>) {
void operator()(_Op& __op) const noexcept {
static_assert(nothrow_tag_invocable<start_t, _Op&>);
(void) tag_invoke(start_t{}, __op);
}
};
Expand All @@ -1230,10 +1231,13 @@ namespace stdexec {

/////////////////////////////////////////////////////////////////////////////
// [execution.op_state]
template <class _O>
concept operation_state = destructible<_O> && std::is_object_v<_O> && requires(_O& __o) {
{ start(__o) } noexcept;
};
template <class _Op>
concept operation_state = //
destructible<_Op> && //
std::is_object_v<_Op> && //
requires(_Op& __op) { //
start(__op);
};

#if !_STD_NO_COROUTINES_
/////////////////////////////////////////////////////////////////////////////
Expand Down
10 changes: 5 additions & 5 deletions test/stdexec/concepts/test_concept_operation_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ struct op_noexcept {
}
};

TEST_CASE(
"type with start CPO that throws is not an operation_state",
"[concepts][operation_state]") {
REQUIRE(!ex::operation_state<op_except>);
}
// TEST_CASE(
// "type with start CPO that throws is not an operation_state",
// "[concepts][operation_state]") {
// REQUIRE(!ex::operation_state<op_except>);
// }

TEST_CASE("type with start CPO noexcept is an operation_state", "[concepts][operation_state]") {
REQUIRE(ex::operation_state<op_noexcept>);
Expand Down
10 changes: 5 additions & 5 deletions test/stdexec/cpos/test_cpo_start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,39 @@ namespace ex = stdexec;
struct my_oper : immovable {
bool started_{false};

friend void tag_invoke(ex::start_t, my_oper& self) {
friend void tag_invoke(ex::start_t, my_oper& self) noexcept {
self.started_ = true;
}
};

struct op_value /*: immovable*/ { // Intentionally movable!
bool* started_;

friend void tag_invoke(ex::start_t, op_value self) {
friend void tag_invoke(ex::start_t, op_value self) noexcept {
*self.started_ = true;
}
};

struct op_rvalref : immovable {
bool* started_;

friend void tag_invoke(ex::start_t, op_rvalref&& self) {
friend void tag_invoke(ex::start_t, op_rvalref&& self) noexcept {
*self.started_ = true;
}
};

struct op_ref : immovable {
bool* started_;

friend void tag_invoke(ex::start_t, op_ref& self) {
friend void tag_invoke(ex::start_t, op_ref& self) noexcept {
*self.started_ = true;
}
};

struct op_cref : immovable {
bool* started_;

friend void tag_invoke(ex::start_t, const op_cref& self) {
friend void tag_invoke(ex::start_t, const op_cref& self) noexcept {
*self.started_ = true;
}
};
Expand Down