Skip to content
Open
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
2 changes: 1 addition & 1 deletion include/exec/any_sender_of.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ namespace exec {
STDEXEC::inplace_stop_source __stop_source_{};
using __stop_callback = typename STDEXEC::stop_token_of_t<
STDEXEC::env_of_t<_Receiver>
>::template callback_type<__forward_stop_request>;
>::template callback_type<STDEXEC::__forward_stop_request>;
std::optional<__stop_callback> __on_stop_{};
};

Expand Down
2 changes: 1 addition & 1 deletion include/exec/start_now.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ namespace exec {

struct start_now_t {
template <
STDEXEC::queryable _Env,
STDEXEC::__queryable _Env,
exec::__scope::__async_scope _AsyncScope,
STDEXEC::sender... _Sender
>
Expand Down
2 changes: 1 addition & 1 deletion include/exec/task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ namespace exec {

private:
using __scheduler_t =
__query_result_or_t<get_scheduler_t, _Context, STDEXEC::inline_scheduler>;
__call_result_or_t<get_scheduler_t, STDEXEC::inline_scheduler, _Context>;

struct __final_awaitable {
static constexpr auto await_ready() noexcept -> bool {
Expand Down
75 changes: 35 additions & 40 deletions include/stdexec/__detail/__completion_behavior.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,50 +95,45 @@ namespace STDEXEC {
//////////////////////////////////////////////////////////////////////////////////////////
// get_completion_behavior: A sender can define this attribute to describe the sender's
// completion behavior
namespace __queries {
template <__completion_tag _Tag>
struct get_completion_behavior_t {
private:
template <class _Attrs, class... _Env>
STDEXEC_ATTRIBUTE(always_inline, host, device)
static constexpr auto __validate() noexcept {
using __result_t = __member_query_result_t<_Attrs, get_completion_behavior_t, _Env...>;
static_assert(
__nothrow_member_queryable_with<_Attrs, get_completion_behavior_t, _Env...>,
"The get_completion_behavior query must be noexcept.");
static_assert(
__std::convertible_to<__result_t, completion_behavior::behavior>,
"The get_completion_behavior query must return one of the static member variables in "
"execution::completion_behavior.");
return __result_t{};
}
template <__completion_tag _Tag>
struct get_completion_behavior_t {
private:
template <class _Attrs, class... _Env>
STDEXEC_ATTRIBUTE(always_inline, host, device)
static constexpr auto __validate() noexcept {
using __result_t = __member_query_result_t<_Attrs, get_completion_behavior_t, _Env...>;
static_assert(
__nothrow_member_queryable_with<_Attrs, get_completion_behavior_t, _Env...>,
"The get_completion_behavior query must be noexcept.");
static_assert(
__std::convertible_to<__result_t, completion_behavior::behavior>,
"The get_completion_behavior query must return one of the static member variables in "
"execution::completion_behavior.");
return __result_t{};
}

public:
template <class _Sig>
static inline constexpr get_completion_behavior_t (*signature)(_Sig) = nullptr;
public:
template <class _Sig>
static inline constexpr get_completion_behavior_t (*signature)(_Sig) = nullptr;

template <class _Attrs, class... _Env>
STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device)
constexpr auto operator()(const _Attrs&, const _Env&...) const noexcept {
if constexpr (
__member_queryable_with<const _Attrs&, get_completion_behavior_t<_Tag>, _Env...>) {
return __validate<_Attrs, _Env...>();
} else if constexpr (__member_queryable_with<
const _Attrs&,
get_completion_behavior_t<_Tag>
>) {
return __validate<_Attrs>();
} else {
return completion_behavior::unknown;
}
template <class _Attrs, class... _Env>
STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device)
constexpr auto operator()(const _Attrs&, const _Env&...) const noexcept {
if constexpr (
__member_queryable_with<const _Attrs&, get_completion_behavior_t<_Tag>, _Env...>) {
return __validate<_Attrs, _Env...>();
} else if constexpr (__member_queryable_with<const _Attrs&, get_completion_behavior_t<_Tag>>) {
return __validate<_Attrs>();
} else {
return completion_behavior::unknown;
}
}

STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device)
static constexpr auto query(forwarding_query_t) noexcept -> bool {
return true;
}
};
} // namespace __queries
STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device)
static constexpr auto query(forwarding_query_t) noexcept -> bool {
return true;
}
};

[[deprecated("use STDEXEC::completion_behavior::weakest instead")]]
inline constexpr const auto& min = completion_behavior::weakest;
Expand Down
16 changes: 15 additions & 1 deletion include/stdexec/__detail/__config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@
#endif

STDEXEC_NAMESPACE_STD_BEGIN
namespace execution {
namespace execution::system_context_replaceability {
}
namespace this_thread {
}
STDEXEC_NAMESPACE_STD_END

Expand Down Expand Up @@ -207,6 +209,18 @@ STDEXEC_NAMESPACE_STD_END
# error stdexec cannot be defined directly in namespace std, but a namespace nested inside std is allowed.
#endif

// clang-format off
#if STDEXEC_NAMESPACE_IS_WITHIN_STD()
# define STDEXEC_P2300_NAMESPACE_BEGIN(...) STDEXEC_NAMESPACE_STD_BEGIN __VA_OPT__(namespace __VA_ARGS__ {)
# define STDEXEC_P2300_NAMESPACE_END(...) __VA_OPT__(}) STDEXEC_NAMESPACE_STD_END
# define STDEXEC_P2300_DEPRECATED_SYMBOL(...) using __VA_ARGS__;
#else
# define STDEXEC_P2300_NAMESPACE_BEGIN(...) namespace STDEXEC {
# define STDEXEC_P2300_NAMESPACE_END(...) }
# define STDEXEC_P2300_DEPRECATED_SYMBOL(...)
#endif
// clang-format on

////////////////////////////////////////////////////////////////////////////////////////////////////
#if __cpp_impl_coroutine >= 2019'02L && __cpp_lib_coroutine >= 2019'02L
# include <coroutine> // IWYU pragma: keep
Expand Down
14 changes: 6 additions & 8 deletions include/stdexec/__detail/__debug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@
namespace STDEXEC {
/////////////////////////////////////////////////////////////////////////////
// Some utilities for debugging senders
namespace __queries {
struct __debug_env_t : __query<__debug_env_t> {
static constexpr auto query(forwarding_query_t) noexcept -> bool {
return true;
}
};
} // namespace __queries
struct __debug_env_t : __query<__debug_env_t> {
static constexpr auto query(forwarding_query_t) noexcept -> bool {
return true;
}
};

namespace __debug {
struct _COMPLETION_SIGNATURES_MISMATCH_ { };
Expand All @@ -59,7 +57,7 @@ namespace STDEXEC {
}

template <class _Env>
using __env_t = env<prop<__queries::__debug_env_t, bool>, _Env>;
using __env_t = env<prop<__debug_env_t, bool>, _Env>;

template <class _CvSender, class _Env, class... _Sigs>
struct __receiver {
Expand Down
Loading
Loading