Skip to content

Commit c11490d

Browse files
committed
avoid the same problem with the fallible_just test sender
1 parent c3c00a8 commit c11490d

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

test/stdexec/algos/adaptors/test_let_error.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,12 @@ namespace {
235235
}
236236

237237
struct int_err_transform {
238-
using my_res_t = decltype(fallible_just{0});
239-
240-
auto operator()(std::exception_ptr ep) const -> my_res_t {
238+
auto operator()(std::exception_ptr ep) const -> fallible_just<int> {
241239
std::rethrow_exception(ep);
242-
return {};
240+
return fallible_just{0};
243241
}
244242

245-
auto operator()(int x) const -> my_res_t {
243+
auto operator()(int x) const -> fallible_just<int> {
246244
return fallible_just{x * 2 - 1};
247245
}
248246
};

test/test_common/senders.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@ namespace {
4242

4343
template <class... Values>
4444
struct fallible_just {
45-
std::tuple<Values...> values_;
4645
using sender_concept = stdexec::sender_t;
4746
using completion_signatures =
4847
ex::completion_signatures<ex::set_value_t(Values...), ex::set_error_t(std::exception_ptr)>;
4948

49+
explicit fallible_just(Values... values)
50+
: values_(std::move(values)...) {
51+
}
52+
5053
template <class Receiver>
5154
struct operation : immovable {
5255
std::tuple<Values...> values_;
@@ -68,6 +71,8 @@ namespace {
6871
-> operation<std::decay_t<Receiver>> {
6972
return {{}, std::move(self.values_), std::forward<Receiver>(rcvr)};
7073
}
74+
75+
std::tuple<Values...> values_;
7176
};
7277

7378
template <class... Values>

0 commit comments

Comments
 (0)