Skip to content

Commit 565c55f

Browse files
authored
Merge pull request #1099 from NVIDIA/just-tag-types
give the `just...` senders proper tag types
2 parents 2684f34 + ba691c8 commit 565c55f

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

include/stdexec/execution.hpp

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,36 +2704,40 @@ namespace stdexec {
27042704
}
27052705
};
27062706

2707-
inline constexpr struct __just_t : __just_impl<__just_t, set_value_t> {
2707+
struct just_t : __just_impl<just_t, set_value_t> {
27082708
template <__movable_value... _Ts>
27092709
STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
27102710
auto
27112711
operator()(_Ts&&... __ts) const noexcept((__nothrow_decay_copyable<_Ts> && ...)) {
2712-
return make_sender_expr<__just_t>(__decayed_tuple<_Ts...>{(_Ts&&) __ts...});
2712+
return make_sender_expr<just_t>(__decayed_tuple<_Ts...>{(_Ts&&) __ts...});
27132713
}
2714-
} just{};
2714+
};
27152715

2716-
inline constexpr struct __just_error_t : __just_impl<__just_error_t, set_error_t> {
2716+
struct just_error_t : __just_impl<just_error_t, set_error_t> {
27172717
template <__movable_value _Error>
27182718
STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
27192719
auto
27202720
operator()(_Error&& __err) const noexcept(__nothrow_decay_copyable<_Error>) {
2721-
return make_sender_expr<__just_error_t>(__decayed_tuple<_Error>{(_Error&&) __err});
2721+
return make_sender_expr<just_error_t>(__decayed_tuple<_Error>{(_Error&&) __err});
27222722
}
2723-
} just_error{};
2723+
};
27242724

2725-
inline constexpr struct __just_stopped_t : __just_impl<__just_stopped_t, set_stopped_t> {
2725+
struct just_stopped_t : __just_impl<just_stopped_t, set_stopped_t> {
27262726
STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
27272727
auto
27282728
operator()() const noexcept {
2729-
return make_sender_expr<__just_stopped_t>(__decayed_tuple<>());
2729+
return make_sender_expr<just_stopped_t>(__decayed_tuple<>());
27302730
}
2731-
} just_stopped{};
2731+
};
27322732
}
27332733

2734-
using __just::just;
2735-
using __just::just_error;
2736-
using __just::just_stopped;
2734+
using __just::just_t;
2735+
using __just::just_error_t;
2736+
using __just::just_stopped_t;
2737+
2738+
inline constexpr just_t just {};
2739+
inline constexpr just_error_t just_error {};
2740+
inline constexpr just_stopped_t just_stopped {};
27372741

27382742
/////////////////////////////////////////////////////////////////////////////
27392743
// [execution.execute]

test/exec/test_variant_sender.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ template <class... Ts>
3030
overloaded(Ts...) -> overloaded<Ts...>;
3131

3232
using just_int_t = decltype(just(0));
33-
using just_t = decltype(just());
33+
using just_void_t = decltype(just());
3434

3535
TEST_CASE("variant_sender - default constructible", "[types][variant_sender]") {
36-
variant_sender<just_t, just_int_t> variant{just()};
36+
variant_sender<just_void_t, just_int_t> variant{just()};
3737
CHECK(variant.index() == 0);
3838
}
3939

4040
TEST_CASE("variant_sender - using an overloaded then adaptor", "[types][variant_sender]") {
41-
variant_sender<just_t, just_int_t> variant = just();
41+
variant_sender<just_void_t, just_int_t> variant = just();
4242
int index = -1;
43-
STATIC_REQUIRE(sender<variant_sender<just_t, just_int_t>>);
43+
STATIC_REQUIRE(sender<variant_sender<just_void_t, just_int_t>>);
4444
sync_wait(variant | then([&index](auto... xs) { index = sizeof...(xs); }));
4545
CHECK(index == 0);
4646

0 commit comments

Comments
 (0)