Skip to content

Commit 73e798e

Browse files
committed
everything in its right place
1 parent b7ef021 commit 73e798e

22 files changed

+1058
-1064
lines changed

include/exec/any_sender_of.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ namespace exec {
855855
STDEXEC::inplace_stop_source __stop_source_{};
856856
using __stop_callback = typename STDEXEC::stop_token_of_t<
857857
STDEXEC::env_of_t<_Receiver>
858-
>::template callback_type<__forward_stop_request>;
858+
>::template callback_type<STDEXEC::__forward_stop_request>;
859859
std::optional<__stop_callback> __on_stop_{};
860860
};
861861

include/exec/start_now.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ namespace exec {
188188

189189
struct start_now_t {
190190
template <
191-
STDEXEC::queryable _Env,
191+
STDEXEC::__queryable _Env,
192192
exec::__scope::__async_scope _AsyncScope,
193193
STDEXEC::sender... _Sender
194194
>

include/exec/task.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ namespace exec {
334334

335335
private:
336336
using __scheduler_t =
337-
__query_result_or_t<get_scheduler_t, _Context, STDEXEC::inline_scheduler>;
337+
__call_result_or_t<get_scheduler_t, STDEXEC::inline_scheduler, _Context>;
338338

339339
struct __final_awaitable {
340340
static constexpr auto await_ready() noexcept -> bool {

include/stdexec/__detail/__completion_behavior.hpp

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -95,50 +95,45 @@ namespace STDEXEC {
9595
//////////////////////////////////////////////////////////////////////////////////////////
9696
// get_completion_behavior: A sender can define this attribute to describe the sender's
9797
// completion behavior
98-
namespace __queries {
99-
template <__completion_tag _Tag>
100-
struct get_completion_behavior_t {
101-
private:
102-
template <class _Attrs, class... _Env>
103-
STDEXEC_ATTRIBUTE(always_inline, host, device)
104-
static constexpr auto __validate() noexcept {
105-
using __result_t = __member_query_result_t<_Attrs, get_completion_behavior_t, _Env...>;
106-
static_assert(
107-
__nothrow_member_queryable_with<_Attrs, get_completion_behavior_t, _Env...>,
108-
"The get_completion_behavior query must be noexcept.");
109-
static_assert(
110-
__std::convertible_to<__result_t, completion_behavior::behavior>,
111-
"The get_completion_behavior query must return one of the static member variables in "
112-
"execution::completion_behavior.");
113-
return __result_t{};
114-
}
98+
template <__completion_tag _Tag>
99+
struct get_completion_behavior_t {
100+
private:
101+
template <class _Attrs, class... _Env>
102+
STDEXEC_ATTRIBUTE(always_inline, host, device)
103+
static constexpr auto __validate() noexcept {
104+
using __result_t = __member_query_result_t<_Attrs, get_completion_behavior_t, _Env...>;
105+
static_assert(
106+
__nothrow_member_queryable_with<_Attrs, get_completion_behavior_t, _Env...>,
107+
"The get_completion_behavior query must be noexcept.");
108+
static_assert(
109+
__std::convertible_to<__result_t, completion_behavior::behavior>,
110+
"The get_completion_behavior query must return one of the static member variables in "
111+
"execution::completion_behavior.");
112+
return __result_t{};
113+
}
115114

116-
public:
117-
template <class _Sig>
118-
static inline constexpr get_completion_behavior_t (*signature)(_Sig) = nullptr;
115+
public:
116+
template <class _Sig>
117+
static inline constexpr get_completion_behavior_t (*signature)(_Sig) = nullptr;
119118

120-
template <class _Attrs, class... _Env>
121-
STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device)
122-
constexpr auto operator()(const _Attrs&, const _Env&...) const noexcept {
123-
if constexpr (
124-
__member_queryable_with<const _Attrs&, get_completion_behavior_t<_Tag>, _Env...>) {
125-
return __validate<_Attrs, _Env...>();
126-
} else if constexpr (__member_queryable_with<
127-
const _Attrs&,
128-
get_completion_behavior_t<_Tag>
129-
>) {
130-
return __validate<_Attrs>();
131-
} else {
132-
return completion_behavior::unknown;
133-
}
119+
template <class _Attrs, class... _Env>
120+
STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device)
121+
constexpr auto operator()(const _Attrs&, const _Env&...) const noexcept {
122+
if constexpr (
123+
__member_queryable_with<const _Attrs&, get_completion_behavior_t<_Tag>, _Env...>) {
124+
return __validate<_Attrs, _Env...>();
125+
} else if constexpr (__member_queryable_with<const _Attrs&, get_completion_behavior_t<_Tag>>) {
126+
return __validate<_Attrs>();
127+
} else {
128+
return completion_behavior::unknown;
134129
}
130+
}
135131

136-
STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device)
137-
static constexpr auto query(forwarding_query_t) noexcept -> bool {
138-
return true;
139-
}
140-
};
141-
} // namespace __queries
132+
STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device)
133+
static constexpr auto query(forwarding_query_t) noexcept -> bool {
134+
return true;
135+
}
136+
};
142137

143138
[[deprecated("use STDEXEC::completion_behavior::weakest instead")]]
144139
inline constexpr const auto& min = completion_behavior::weakest;

include/stdexec/__detail/__config.hpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@
179179
#endif
180180

181181
STDEXEC_NAMESPACE_STD_BEGIN
182-
namespace execution {
182+
namespace execution::system_context_replaceability {
183+
}
184+
namespace this_thread {
183185
}
184186
STDEXEC_NAMESPACE_STD_END
185187

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

212+
// clang-format off
213+
#if STDEXEC_NAMESPACE_IS_WITHIN_STD()
214+
# define STDEXEC_P2300_NAMESPACE_BEGIN(...) STDEXEC_NAMESPACE_STD_BEGIN __VA_OPT__(namespace __VA_ARGS__ {)
215+
# define STDEXEC_P2300_NAMESPACE_END(...) __VA_OPT__(}) STDEXEC_NAMESPACE_STD_END
216+
# define STDEXEC_P2300_DEPRECATED_SYMBOL(...) using __VA_ARGS__;
217+
#else
218+
# define STDEXEC_P2300_NAMESPACE_BEGIN(...) namespace STDEXEC {
219+
# define STDEXEC_P2300_NAMESPACE_END(...) }
220+
# define STDEXEC_P2300_DEPRECATED_SYMBOL(...)
221+
#endif
222+
// clang-format on
223+
210224
////////////////////////////////////////////////////////////////////////////////////////////////////
211225
#if __cpp_impl_coroutine >= 2019'02L && __cpp_lib_coroutine >= 2019'02L
212226
# include <coroutine> // IWYU pragma: keep

include/stdexec/__detail/__debug.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@
2929
namespace STDEXEC {
3030
/////////////////////////////////////////////////////////////////////////////
3131
// Some utilities for debugging senders
32-
namespace __queries {
33-
struct __debug_env_t : __query<__debug_env_t> {
34-
static constexpr auto query(forwarding_query_t) noexcept -> bool {
35-
return true;
36-
}
37-
};
38-
} // namespace __queries
32+
struct __debug_env_t : __query<__debug_env_t> {
33+
static constexpr auto query(forwarding_query_t) noexcept -> bool {
34+
return true;
35+
}
36+
};
3937

4038
namespace __debug {
4139
struct _COMPLETION_SIGNATURES_MISMATCH_ { };
@@ -59,7 +57,7 @@ namespace STDEXEC {
5957
}
6058

6159
template <class _Env>
62-
using __env_t = env<prop<__queries::__debug_env_t, bool>, _Env>;
60+
using __env_t = env<prop<__debug_env_t, bool>, _Env>;
6361

6462
template <class _CvSender, class _Env, class... _Sigs>
6563
struct __receiver {

0 commit comments

Comments
 (0)