From aebb404aeb4035e85a4476630fb8ae85b6aee41d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Thu, 8 Jan 2026 23:40:35 +0000 Subject: [PATCH 1/2] updated the code to match P3325 --- Makefile | 2 +- bin/update-cmake-headers.py | 13 ++-- docs/dependency.txt | 18 +++--- docs/overview.md | 18 +++--- examples/just_stopped.cpp | 2 +- .../detail/completion_signatures_of_t.hpp | 6 +- .../beman/execution/detail/default_impls.hpp | 4 +- include/beman/execution/detail/empty_env.hpp | 21 ------- include/beman/execution/detail/env.hpp | 63 +++++++++++++++++++ .../execution/detail/error_types_of_t.hpp | 4 +- include/beman/execution/detail/get_env.hpp | 4 +- include/beman/execution/detail/let.hpp | 4 +- .../beman/execution/detail/non_assignable.hpp | 25 ++++++++ include/beman/execution/detail/prop.hpp | 43 +++++++++---- include/beman/execution/detail/sender.hpp | 4 +- include/beman/execution/detail/sender_in.hpp | 4 +- .../beman/execution/detail/sends_stopped.hpp | 12 ++-- include/beman/execution/detail/spawn.hpp | 4 +- .../beman/execution/detail/spawn_future.hpp | 4 +- .../execution/detail/value_types_of_t.hpp | 4 +- include/beman/execution/detail/when_all.hpp | 6 +- include/beman/execution/execution.hpp | 2 +- include/beman/execution26/execution.hpp | 2 +- src/beman/execution/CMakeLists.txt | 3 +- src/beman/execution/execution.cppm | 2 +- tests/beman/execution/CMakeLists.txt | 2 + .../execution/exec-continues-on.test.cpp | 2 +- tests/beman/execution/exec-env.test.cpp | 28 +++++++++ .../exec-get-delegation-scheduler.test.cpp | 4 +- tests/beman/execution/exec-get-env.test.cpp | 6 +- .../execution/exec-into-variant.test.cpp | 6 +- tests/beman/execution/exec-just.test.cpp | 16 +++-- tests/beman/execution/exec-let.test.cpp | 4 +- tests/beman/execution/exec-on.test.cpp | 4 +- tests/beman/execution/exec-prop.test.cpp | 8 ++- tests/beman/execution/exec-read-env.test.cpp | 2 +- tests/beman/execution/exec-snd-expos.test.cpp | 24 +++---- .../execution/exec-spawn-future.test.cpp | 6 +- tests/beman/execution/exec-split.test.cpp | 9 ++- tests/beman/execution/exec-starts-on.test.cpp | 2 +- tests/beman/execution/exec-then.test.cpp | 2 +- .../execution/exec-utils-cmplsigs.test.cpp | 22 +++---- tests/beman/execution/exec-when-all.test.cpp | 2 +- .../beman/execution/execution-module.test.cpp | 4 +- tests/beman/execution/execution-syn.test.cpp | 36 +++++------ tests/beman/execution/non_assignable.test.cpp | 18 ++++++ 46 files changed, 306 insertions(+), 175 deletions(-) delete mode 100644 include/beman/execution/detail/empty_env.hpp create mode 100644 include/beman/execution/detail/env.hpp create mode 100644 include/beman/execution/detail/non_assignable.hpp create mode 100644 tests/beman/execution/exec-env.test.cpp create mode 100644 tests/beman/execution/non_assignable.test.cpp diff --git a/Makefile b/Makefile index 83545dd7..825c9daf 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ ifeq (${hostSystemName},Darwin) else ifeq (${hostSystemName},Linux) export LLVM_DIR=/usr/lib/llvm-20 export PATH:=${LLVM_DIR}/bin:${PATH} - export CXX=clang++-20 + # export CXX=clang++-20 else export CXX=$(COMPILER) endif diff --git a/bin/update-cmake-headers.py b/bin/update-cmake-headers.py index 7c53b0ce..08a293d5 100755 --- a/bin/update-cmake-headers.py +++ b/bin/update-cmake-headers.py @@ -23,13 +23,8 @@ def get_headers(dir): return result -sections = { - "public": get_headers("include/beman/*"), - "detail": get_headers("include/beman/*/detail"), -} - file_set_re = re.compile(" *FILE_SET.*") -section_re = re.compile(" *\${TARGET_NAME}_(?P
.*)_headers$") +section_re = re.compile(" *FILE_SET *\${TARGET_NAME}_(?P
.*)_headers$") header_re = re.compile(" *\${PROJECT_SOURCE_DIR}/include/beman/.*/.*\.hpp") if len(sys.argv) != 2: @@ -41,6 +36,10 @@ def get_headers(dir): section = "" section_done = False +sections = { + "public": get_headers("include/beman/*"), + "detail": get_headers("include/beman/*/detail"), +} with open(cmake, "r") as input: lines = input.readlines() @@ -58,7 +57,7 @@ def get_headers(dir): section_done = True project = "${PROJECT_SOURCE_DIR}" for header in sections[section]: - output.write(f" {project}/include/{header}.hpp\n") + output.write(f" {project}/include/{header}.hpp\n") else: output.write(line) pass diff --git a/docs/dependency.txt b/docs/dependency.txt index b88965b1..3af8d059 100644 --- a/docs/dependency.txt +++ b/docs/dependency.txt @@ -57,7 +57,7 @@ completion_signature set_stopped completion_signature set_value completion_signatures_for completion_signatures completion_signatures_of_t call_result_t -completion_signatures_of_t empty_env +completion_signatures_of_t env completion_signatures_of_t get_completion_signatures completion_signatures_of_t sender_in completion_tag set_error @@ -98,7 +98,7 @@ default_domain queryable default_domain sender default_domain tag_of_t default_impls callable -default_impls empty_env +default_impls env default_impls fwd_env default_impls get_env default_impls start @@ -107,7 +107,7 @@ default_set_error set_value default_set_value completion_signatures default_set_value set_value emplace_from call_result_t -enable_sender empty_env +enable_sender env enable_sender env_promise enable_sender is_awaitable enable_sender is_sender @@ -153,7 +153,7 @@ get_domain_late get_domain get_domain_late get_scheduler get_domain_late query_with_default get_domain_late sender_for -get_env empty_env +get_env env get_env mandate_nothrow get_env queryable get_forward_progress_guarantee forward_progress_guarantee @@ -201,7 +201,7 @@ let_error connect_result_t let_error decayed_tuple let_error decayed_typeof let_error default_impls -let_error empty_env +let_error env let_error fwd_env let_error get_completion_scheduler let_error get_domain @@ -226,7 +226,7 @@ let_stopped connect_result_t let_stopped decayed_tuple let_stopped decayed_typeof let_stopped default_impls -let_stopped empty_env +let_stopped env let_stopped fwd_env let_stopped get_completion_scheduler let_stopped get_domain @@ -251,7 +251,7 @@ let_value connect_result_t let_value decayed_tuple let_value decayed_typeof let_value default_impls -let_value empty_env +let_value env let_value fwd_env let_value get_completion_scheduler let_value get_domain @@ -371,7 +371,7 @@ sender_in_of sender_in sender_in_of set_value sender_in_of value_signature sender_in_of value_types_of_t -sender_of empty_env +sender_of env sender_of sender_in_of sender_of tag_of_t sender_to completion_signatures_of_t @@ -493,7 +493,7 @@ value_types_of_t variant_or_empty variant_or_empty empty_variant when_all default_domain when_all emplace_value -when_all empty_env +when_all env when_all env_of_t when_all get_domain when_all get_domain_early diff --git a/docs/overview.md b/docs/overview.md index 634ed1ec..e226623f 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -19,7 +19,7 @@ When an asynchronous operation completes it _signals_ its completion by calling
environment -The term _enviroment_ refers to the bag of properties associated with an _object_ by the call std::execution::get_env(_object_). By default the environment for objects is empty (std::execution::empty_env). In particular, environments associated with receivers are used to provide access to properties like the stop token, scheduler, or allocator associated with the receiver. The various properties associated with an object are accessed via queries. +The term _enviroment_ refers to the bag of properties associated with an _object_ by the call std::execution::get_env(_object_). By default the environment for objects is empty (std::execution::env<>). In particular, environments associated with receivers are used to provide access to properties like the stop token, scheduler, or allocator associated with the receiver. The various properties associated with an object are accessed via queries.
## Concepts @@ -70,7 +70,7 @@ Required members for _Receiver_: - The type `receiver_concept` is an alias for `receiver_t` or a type derived thereof`. - Rvalues of type _Receiver_ are movable. - Lvalues of type _Receiver_ are copyable. -- std::execution::get_env(_receiver_) returns an object. By default this operation returns std::execution::empty_env. +- std::execution::get_env(_receiver_) returns an object. By default this operation returns std::execution::env<>. Typical members for _Receiver_: @@ -177,7 +177,7 @@ Senders represent asynchronous work. They may get composed from multiple senders Requirements for _Sender_: - The type _Sender_::sender_concept is an alias for `sender_t` or a type derived thereof or _Sender_ is a suitable _awaitable_. -- std::execution::get_env(_sender_) is valid. By default this operation returns std::execution::empty_env. +- std::execution::get_env(_sender_) is valid. By default this operation returns std::execution::env<>. - Rvalues of type _Sender_ can be moved. - Lvalues of type _Sender_ can be copied. @@ -224,7 +224,7 @@ static_assert(std::execution::sender);
-sender_in<Sender, Env = std::execution::empty_env> +sender_in<Sender, Env = std::execution::env<>> The concept sender_in<Sender, Env> tests whether _Sender_ is a sender, _Env_ is a destructible type, and std::execution::get_completion_signatures(_sender_, _env_) yields a specialization of std::execution::completion_signatures.
@@ -236,7 +236,7 @@ The concept sender_to<Sender, Receiver> tests if _Receiver_ can receive all completion signals from _Sender_ it checks that for each _Signature_ in std::execution::get_completion_signals(_sender_, std::declval<std::execution::env_of_t<_Receiver_>>()) the test std::execution::receiver_of<_Receiver_, _Signature_> yields true. To determine if _Sender_ can be connected to _Receiver_ the concept checks if connect(std::declval<_Sender_>(), std::declval<_Receiver_>) is a valid expression.
-sends_stopped<Sender, Env = std::execution::empty_env> +sends_stopped<Sender, Env = std::execution::env<>> The concept sends_stopped<Sender, Env> determines if _Sender_ may send a stopped completion signal. To do so, the concepts determines if std::execution::get_completion_signals(_sender_, _env_) contains the signatures std::execution::set_stopped_t().
@@ -407,12 +407,12 @@ struct custom_t: forwarding_query_t {
get_env(queryable) -> env -**Default**: `empty_env` +**Default**: `env<>`
-The expression get_env(queryable) is used to get the environment env associated with queryable. To provide a non-default environment for a queryable a `get_env` member needs to be defined. If queryable doesn’t provide the get_env query an object of type empty_env is returned. +The expression get_env(queryable) is used to get the environment env associated with queryable. To provide a non-default environment for a queryable a `get_env` member needs to be defined. If queryable doesn’t provide the get_env query an object of type env<> is returned. The value of the expression is
  1. the result of as_const(queryable).get_env() if this expression is valid and noexcept.
  2. -
  3. empty_env otherwise. +
  4. env<> otherwise.
@@ -712,7 +712,7 @@ The expression into_variant(sender) creates a sender which t - `completion_signatures_t` - `connect_result_t` - `default_domain` -- `empty_env` +- `env<T...>` - `env_of_t` - `error_types_of_t` - `fwd_env` diff --git a/examples/just_stopped.cpp b/examples/just_stopped.cpp index 7c2499f9..ad0c668a 100644 --- a/examples/just_stopped.cpp +++ b/examples/just_stopped.cpp @@ -11,7 +11,7 @@ struct receiver { int main() { // ex::sync_wait(ex::just_stopped() | ex::then([]{})); auto then = ex::just_stopped() | ex::then([] {}); - static_assert(std::same_as); + static_assert(std::same_as()))>); ex::connect(ex::just_stopped() | ex::then([] {}), receiver{}); } diff --git a/include/beman/execution/detail/completion_signatures_of_t.hpp b/include/beman/execution/detail/completion_signatures_of_t.hpp index ee3bcc7d..c1889484 100644 --- a/include/beman/execution/detail/completion_signatures_of_t.hpp +++ b/include/beman/execution/detail/completion_signatures_of_t.hpp @@ -5,7 +5,7 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_COMPLETION_SIGNATURES_OF #include -#include +#include #include #include @@ -16,10 +16,10 @@ namespace beman::execution { * \brief Alias to access the completion signatures of a sender * \headerfile beman/execution/execution.hpp */ -template +template > requires ::beman::execution::sender_in using completion_signatures_of_t = - ::beman::execution::detail::call_result_t< ::beman::execution::get_completion_signatures_t, Sender, Env>; + ::beman::execution::detail::call_result_t<::beman::execution::get_completion_signatures_t, Sender, Env>; } // namespace beman::execution // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/default_impls.hpp b/include/beman/execution/detail/default_impls.hpp index 91e0c456..14e10c86 100644 --- a/include/beman/execution/detail/default_impls.hpp +++ b/include/beman/execution/detail/default_impls.hpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include @@ -30,7 +30,7 @@ struct default_impls { if constexpr (1 == sizeof...(child)) return (::beman::execution::detail::fwd_env(::beman::execution::get_env(child)), ...); else - return ::beman::execution::empty_env{}; + return ::beman::execution::env<>{}; }; static constexpr auto get_env = [](auto, auto&, const auto& receiver) noexcept -> decltype(auto) { return ::beman::execution::detail::fwd_env(::beman::execution::get_env(receiver)); diff --git a/include/beman/execution/detail/empty_env.hpp b/include/beman/execution/detail/empty_env.hpp deleted file mode 100644 index ce1db524..00000000 --- a/include/beman/execution/detail/empty_env.hpp +++ /dev/null @@ -1,21 +0,0 @@ -// include/beman/execution/detail/empty_env.hpp -*-C++-*- -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -#ifndef INCLUDED_BEMAN_EXECUTION_DETAIL_EMPTY_ENV -#define INCLUDED_BEMAN_EXECUTION_DETAIL_EMPTY_ENV - -#include - -// ---------------------------------------------------------------------------- - -namespace beman::execution { -/*! - * \brief An empty type used as an environment when there is no environment available - * \headerfile beman/execution/execution.hpp - */ -struct empty_env {}; -} // namespace beman::execution - -// ---------------------------------------------------------------------------- - -#endif diff --git a/include/beman/execution/detail/env.hpp b/include/beman/execution/detail/env.hpp new file mode 100644 index 00000000..b7b6610c --- /dev/null +++ b/include/beman/execution/detail/env.hpp @@ -0,0 +1,63 @@ +// include/beman/execution/detail/env.hpp -*-C++-*- +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef INCLUDED_INCLUDE_BEMAN_EXECUTION_DETAIL_ENV +#define INCLUDED_INCLUDE_BEMAN_EXECUTION_DETAIL_ENV + +#include +#include +#include + +// ---------------------------------------------------------------------------- + +namespace beman::execution::detail { +template <::beman::execution::detail::queryable> +struct env_base; + +template +concept has_query = requires(const E& e) { e.query(::std::declval()); }; + +template +struct find_env; +template + requires has_query +struct find_env { + using type = E0; +}; +template + requires(not has_query) +struct find_env { + using type = typename find_env::type; +}; +} // namespace beman::execution::detail + +namespace beman::execution { +template <::beman::execution::detail::queryable... Envs> +struct env; + +template <::beman::execution::detail::queryable... Envs> +env(Envs...) -> env<::std::unwrap_reference_t...>; +} // namespace beman::execution + +// ---------------------------------------------------------------------------- + +template <::beman::execution::detail::queryable Env> +struct beman::execution::detail::env_base { + Env env_; +}; + +template <::beman::execution::detail::queryable... Envs> +struct beman::execution::env : ::beman::execution::detail::env_base... { + [[no_unique_address]] ::beman::execution::detail::non_assignable na_{}; + + template + requires(::beman::execution::detail::has_query || ...) + constexpr auto query(Q q) const noexcept -> decltype(auto) { + using E = typename ::beman::execution::detail::find_env::type; + return q(static_cast&>(*this).env_); + } +}; + +// ---------------------------------------------------------------------------- + +#endif diff --git a/include/beman/execution/detail/error_types_of_t.hpp b/include/beman/execution/detail/error_types_of_t.hpp index 1d7bf242..f1c1dcb3 100644 --- a/include/beman/execution/detail/error_types_of_t.hpp +++ b/include/beman/execution/detail/error_types_of_t.hpp @@ -5,7 +5,7 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_ERROR_TYPES_OF #include -#include +#include #include #include #include @@ -20,7 +20,7 @@ namespace beman::execution { * \headerfile beman/execution/execution.hpp */ template , template class Variant = ::beman::execution::detail::variant_or_empty> requires ::beman::execution::sender_in using error_types_of_t = diff --git a/include/beman/execution/detail/get_env.hpp b/include/beman/execution/detail/get_env.hpp index 92aebd3c..5d94ff15 100644 --- a/include/beman/execution/detail/get_env.hpp +++ b/include/beman/execution/detail/get_env.hpp @@ -5,7 +5,7 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_GET_ENV #include -#include +#include #include #include @@ -25,7 +25,7 @@ struct get_env_t { "get_env requires the result type to be destructible"); return obj.get_env(); } else { - return ::beman::execution::empty_env{}; + return ::beman::execution::env<>{}; } } }; diff --git a/include/beman/execution/detail/let.hpp b/include/beman/execution/detail/let.hpp index 499210af..32d30e30 100644 --- a/include/beman/execution/detail/let.hpp +++ b/include/beman/execution/detail/let.hpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -77,7 +77,7 @@ struct let_t { return ::beman::execution::detail::make_env( ::beman::execution::get_domain, ::beman::execution::get_domain(::beman::execution::get_env(sender))); else - return ::beman::execution::empty_env{}; + return ::beman::execution::env<>{}; } template static auto join_env(Sender&& sender, Env&& e) -> decltype(auto) { diff --git a/include/beman/execution/detail/non_assignable.hpp b/include/beman/execution/detail/non_assignable.hpp new file mode 100644 index 00000000..b2f9caa4 --- /dev/null +++ b/include/beman/execution/detail/non_assignable.hpp @@ -0,0 +1,25 @@ +// include/beman/execution/detail/non_assignable.hpp -*-C++-*- +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef INCLUDED_INCLUDE_BEMAN_EXECUTION_DETAIL_NON_ASSIGNABLE +#define INCLUDED_INCLUDE_BEMAN_EXECUTION_DETAIL_NON_ASSIGNABLE + +// ---------------------------------------------------------------------------- + +namespace beman::execution::detail { +struct non_assignable; +} + +// ---------------------------------------------------------------------------- + +struct beman::execution::detail::non_assignable { + non_assignable() = default; + non_assignable(non_assignable&&) = default; + non_assignable(const non_assignable&) = default; + auto operator=(non_assignable&&) -> non_assignable& = delete; + auto operator=(const non_assignable&) -> non_assignable& = delete; +}; + +// ---------------------------------------------------------------------------- + +#endif diff --git a/include/beman/execution/detail/prop.hpp b/include/beman/execution/detail/prop.hpp index 1b2cdf23..73b95e03 100644 --- a/include/beman/execution/detail/prop.hpp +++ b/include/beman/execution/detail/prop.hpp @@ -4,30 +4,47 @@ #ifndef INCLUDED_INCLUDE_BEMAN_EXECUTION_DETAIL_PROP #define INCLUDED_INCLUDE_BEMAN_EXECUTION_DETAIL_PROP +#include +#include #include // ---------------------------------------------------------------------------- +namespace beman::execution::detail { +template +struct prop_like; +} + namespace beman::execution { template -struct prop { - [[no_unique_address]] Query query_{}; - Value value_; - - template - prop(Q q, V&& v) : query_(q), value_(v) {} - prop(prop&&) = default; - prop(const prop&) = default; - auto operator=(prop&&) = delete; - auto operator=(const prop&) = delete; - - constexpr auto query(Query) const noexcept -> Value { return this->value_; } -}; +struct prop; template prop(Query, Value) -> prop>; } // namespace beman::execution +template +struct beman::execution::detail::prop_like { + V value; + auto query(auto) const noexcept -> const V& { return this->value; } +}; + +template +struct beman::execution::prop { + static_assert(::beman::execution::detail::callable>); + + [[no_unique_address]] Query query_{}; + [[no_unique_address]] Value value_{}; + [[no_unique_address]] ::beman::execution::detail::non_assignable non_assignable_{}; + + // prop(prop&&) = default; + // prop(const prop&) = default; + // auto operator=(prop&&) -> prop& = delete; + // auto operator=(const prop&) -> prop& = delete; + + constexpr auto query(Query) const noexcept -> const Value& { return this->value_; } +}; + // ---------------------------------------------------------------------------- #endif diff --git a/include/beman/execution/detail/sender.hpp b/include/beman/execution/detail/sender.hpp index 91055628..d9dcf27f 100644 --- a/include/beman/execution/detail/sender.hpp +++ b/include/beman/execution/detail/sender.hpp @@ -4,7 +4,7 @@ #ifndef INCLUDED_BEMAN_EXECUTION_DETAIL_SENDER #define INCLUDED_BEMAN_EXECUTION_DETAIL_SENDER -#include +#include #include #include #include @@ -25,7 +25,7 @@ template concept enable_sender = ::beman::execution::detail::is_sender || ::beman::execution::detail::is_awaitable>; + ::beman::execution::detail::env_promise<::beman::execution::env<>>>; } // namespace beman::execution::detail namespace beman::execution { template diff --git a/include/beman/execution/detail/sender_in.hpp b/include/beman/execution/detail/sender_in.hpp index cf2c4f60..8b247051 100644 --- a/include/beman/execution/detail/sender_in.hpp +++ b/include/beman/execution/detail/sender_in.hpp @@ -4,7 +4,7 @@ #ifndef INCLUDED_BEMAN_EXECUTION_DETAIL_SENDER_IN #define INCLUDED_BEMAN_EXECUTION_DETAIL_SENDER_IN -#include +#include #include #include #include @@ -13,7 +13,7 @@ // ---------------------------------------------------------------------------- namespace beman::execution { -template +template > concept sender_in = ::beman::execution::sender && ::beman::execution::detail::queryable && requires(Sender&& sender, Env&& env) { diff --git a/include/beman/execution/detail/sends_stopped.hpp b/include/beman/execution/detail/sends_stopped.hpp index b94daae1..54e22c44 100644 --- a/include/beman/execution/detail/sends_stopped.hpp +++ b/include/beman/execution/detail/sends_stopped.hpp @@ -5,7 +5,7 @@ #define INCLUDED_BEMAN_EXECUTION_DETAIL_SENDS_STOPPED #include -#include +#include #include #include #include @@ -15,14 +15,14 @@ // ---------------------------------------------------------------------------- namespace beman::execution { -template +template > requires ::beman::execution::sender_in inline constexpr bool sends_stopped{!::std::same_as< ::beman::execution::detail::type_list<>, - ::beman::execution::detail::gather_signatures< ::beman::execution::set_stopped_t, - ::beman::execution::completion_signatures_of_t, - ::beman::execution::detail::type_list, - ::beman::execution::detail::type_list> >}; + ::beman::execution::detail::gather_signatures<::beman::execution::set_stopped_t, + ::beman::execution::completion_signatures_of_t, + ::beman::execution::detail::type_list, + ::beman::execution::detail::type_list>>}; } // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/spawn.hpp b/include/beman/execution/detail/spawn.hpp index f45441a8..c73f6b82 100644 --- a/include/beman/execution/detail/spawn.hpp +++ b/include/beman/execution/detail/spawn.hpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include @@ -78,7 +78,7 @@ struct spawn_t { } template <::beman::execution::sender Sender, ::beman::execution::scope_token Token> auto operator()(Sender&& sender, Token&& token) const { - return (*this)(::std::forward(sender), ::std::forward(token), ::beman::execution::empty_env{}); + return (*this)(::std::forward(sender), ::std::forward(token), ::beman::execution::env<>{}); } }; } // namespace beman::execution::detail diff --git a/include/beman/execution/detail/spawn_future.hpp b/include/beman/execution/detail/spawn_future.hpp index bafbce0e..7f80ab12 100644 --- a/include/beman/execution/detail/spawn_future.hpp +++ b/include/beman/execution/detail/spawn_future.hpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -243,7 +243,7 @@ class spawn_future_t { } template <::beman::execution::sender Sndr, ::beman::execution::scope_token Tok> auto operator()(Sndr&& sndr, Tok&& tok) const { - return (*this)(::std::forward(sndr), ::std::forward(tok), ::beman::execution::empty_env{}); + return (*this)(::std::forward(sndr), ::std::forward(tok), ::beman::execution::env<>{}); } }; diff --git a/include/beman/execution/detail/value_types_of_t.hpp b/include/beman/execution/detail/value_types_of_t.hpp index 5937c0ad..87274572 100644 --- a/include/beman/execution/detail/value_types_of_t.hpp +++ b/include/beman/execution/detail/value_types_of_t.hpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include @@ -15,7 +15,7 @@ namespace beman::execution { template , template class Tuple = ::beman::execution::detail::decayed_tuple, template class Variant = ::beman::execution::detail::variant_or_empty> requires ::beman::execution::sender_in diff --git a/include/beman/execution/detail/when_all.hpp b/include/beman/execution/detail/when_all.hpp index 40f130f7..daa373d2 100644 --- a/include/beman/execution/detail/when_all.hpp +++ b/include/beman/execution/detail/when_all.hpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -53,7 +53,7 @@ struct when_all_t { requires(0u != sizeof...(Sender)) && ((::beman::execution::detail::meta::size_v< ::beman::execution::value_types_of_t, ::std::tuple, ::beman::execution::detail::type_list>> == 1u) && ...) && @@ -81,7 +81,7 @@ struct impls_for<::beman::execution::detail::when_all_t> : ::beman::execution::d using common_t = typename ::std::common_type_t; if constexpr (::std::same_as) - return ::beman::execution::empty_env{}; + return ::beman::execution::env<>{}; else return ::beman::execution::detail::make_env(::beman::execution::get_domain, common_t{}); }}; diff --git a/include/beman/execution/execution.hpp b/include/beman/execution/execution.hpp index 973eeecc..c5bb7748 100644 --- a/include/beman/execution/execution.hpp +++ b/include/beman/execution/execution.hpp @@ -7,7 +7,7 @@ // ---------------------------------------------------------------------------- #include -#include +#include #include #include #include diff --git a/include/beman/execution26/execution.hpp b/include/beman/execution26/execution.hpp index d3d6fa52..b6d84148 100644 --- a/include/beman/execution26/execution.hpp +++ b/include/beman/execution26/execution.hpp @@ -28,7 +28,7 @@ using ::beman::execution::connect_t; using ::beman::execution::continues_on; using ::beman::execution::continues_on_t; using ::beman::execution::default_domain; -using ::beman::execution::empty_env; +using ::beman::execution::env; using ::beman::execution::env_of_t; using ::beman::execution::error_types_of_t; using ::beman::execution::forwarding_query; diff --git a/src/beman/execution/CMakeLists.txt b/src/beman/execution/CMakeLists.txt index ecc5d4e4..fc15f853 100644 --- a/src/beman/execution/CMakeLists.txt +++ b/src/beman/execution/CMakeLists.txt @@ -71,7 +71,7 @@ target_sources( ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/default_domain.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/default_impls.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/emplace_from.hpp - ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/empty_env.hpp + ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/env.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/env_of_t.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/env_promise.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/env_type.hpp @@ -119,6 +119,7 @@ target_sources( ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/meta_unique.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/movable_value.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/never_stop_token.hpp + ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/non_assignable.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/nostopstate.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/nothrow_callable.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/detail/notify.hpp diff --git a/src/beman/execution/execution.cppm b/src/beman/execution/execution.cppm index a0e8e00a..b8c57614 100644 --- a/src/beman/execution/execution.cppm +++ b/src/beman/execution/execution.cppm @@ -81,7 +81,7 @@ export using ::beman::execution::get_delegation_scheduler; //-dk:TODO export using ::beman::execution::get_forward_progress_guarantee; export using ::beman::execution::get_completion_scheduler; -export using ::beman::execution::empty_env; +export using ::beman::execution::env; export using ::beman::execution::get_env_t; export using ::beman::execution::get_env; diff --git a/tests/beman/execution/CMakeLists.txt b/tests/beman/execution/CMakeLists.txt index 0db8ff9d..01511154 100644 --- a/tests/beman/execution/CMakeLists.txt +++ b/tests/beman/execution/CMakeLists.txt @@ -25,7 +25,9 @@ list( exec-scope-counting.test exec-spawn.test exec-stop-when.test + non_assignable.test exec-prop.test + exec-env.test exec-scope-simple-counting.test exec-spawn-future.test exec-scope-concepts.test diff --git a/tests/beman/execution/exec-continues-on.test.cpp b/tests/beman/execution/exec-continues-on.test.cpp index 7ce776b9..b743a03f 100644 --- a/tests/beman/execution/exec-continues-on.test.cpp +++ b/tests/beman/execution/exec-continues-on.test.cpp @@ -73,7 +73,7 @@ auto test_constraints(Scheduler&& scheduler, Sender&& sender) { test::check_type(domain); auto s{test_std::continues_on(::std::forward(sender), ::std::forward(scheduler))}; - auto late{test_detail::get_domain_late(s, test_std::empty_env{})}; + auto late{test_detail::get_domain_late(s, test_std::env<>{})}; test::check_type(late); } } diff --git a/tests/beman/execution/exec-env.test.cpp b/tests/beman/execution/exec-env.test.cpp new file mode 100644 index 00000000..06142af1 --- /dev/null +++ b/tests/beman/execution/exec-env.test.cpp @@ -0,0 +1,28 @@ +// tests/beman/execution/exec-env.test.cpp -*-C++-*- +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#include +#include +#include +#include +#include +#include + +namespace {} + +// ---------------------------------------------------------------------------- + +int main() { + test_std::inplace_stop_source source{}; + test_std::env<> e0{}; + [[maybe_unused]] test_std::env e1{test_std::prop(test_std::get_allocator, std::allocator{})}; + [[maybe_unused]] test_std::env e2{test_std::prop(test_std::get_allocator, std::allocator{}), + test_std::prop(test_std::get_stop_token, source.get_token())}; + [[maybe_unused]] auto a1 = e1.query(test_std::get_allocator); + [[maybe_unused]] auto a2 = e2.query(test_std::get_allocator); + [[maybe_unused]] auto s2 = e2.query(test_std::get_stop_token); + assert(s2 == source.get_token()); + + static_assert(not std::is_assignable_v, test_std::env<>>); +} diff --git a/tests/beman/execution/exec-get-delegation-scheduler.test.cpp b/tests/beman/execution/exec-get-delegation-scheduler.test.cpp index 609f72d0..48cc5e74 100644 --- a/tests/beman/execution/exec-get-delegation-scheduler.test.cpp +++ b/tests/beman/execution/exec-get-delegation-scheduler.test.cpp @@ -3,7 +3,7 @@ #include -#include +#include #include #include #include @@ -64,7 +64,7 @@ TEST(exec_get_delegation_scheduler) { std::same_as); static_assert(test_std::forwarding_query((test_std::get_delegation_scheduler))); - test_get_delegation_scheduler(test_std::empty_env{}); + test_get_delegation_scheduler(test_std::env<>{}); test_get_delegation_scheduler(env{}); test_get_delegation_scheduler(env{}); test_get_delegation_scheduler(env{17}); diff --git a/tests/beman/execution/exec-get-env.test.cpp b/tests/beman/execution/exec-get-env.test.cpp index c1037adf..2215cf17 100644 --- a/tests/beman/execution/exec-get-env.test.cpp +++ b/tests/beman/execution/exec-get-env.test.cpp @@ -42,17 +42,17 @@ struct normal { } // namespace TEST(exec_get_env) { - static_assert(std::semiregular); + // static_assert(std::semiregular>); static_assert(std::semiregular); static_assert(std::same_as); auto e0 = test_std::get_env(0); test::use(e0); - static_assert(std::same_as); + static_assert(std::same_as, decltype(e0)>); auto e1 = test_std::get_env(non_const{}); test::use(e1); - static_assert(std::same_as); + static_assert(std::same_as, decltype(e1)>); auto e2 = test_std::get_env(normal{}); test::use(e2); static_assert(std::same_as); diff --git a/tests/beman/execution/exec-into-variant.test.cpp b/tests/beman/execution/exec-into-variant.test.cpp index 4779914d..ed019ce7 100644 --- a/tests/beman/execution/exec-into-variant.test.cpp +++ b/tests/beman/execution/exec-into-variant.test.cpp @@ -56,15 +56,15 @@ auto test_into_variant(auto&& sender) -> void { static_assert(requires { typename std::decay_t; typename std::decay_t::completion_signatures; - test_std::get_completion_signatures(sender, test_std::empty_env{}); - typename test_std::value_types_of_t, test_std::empty_env>; + test_std::get_completion_signatures(sender, test_std::env<>{}); + typename test_std::value_types_of_t, test_std::env<>>; test_std::into_variant(sender); test_std::connect(test_std::into_variant(sender), receiver{}); { test_std::connect(test_std::into_variant(sender), receiver{}) } -> test_std::operation_state; }); static_assert(std::same_as); + test_std::env<>{}))>); bool called{false}; auto op{test_std::connect(test_std::into_variant(sender), receiver{&called})}; ASSERT(not called); diff --git a/tests/beman/execution/exec-just.test.cpp b/tests/beman/execution/exec-just.test.cpp index b365a785..52187247 100644 --- a/tests/beman/execution/exec-just.test.cpp +++ b/tests/beman/execution/exec-just.test.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -#include +#include #include #include #include @@ -32,12 +32,10 @@ auto test_just_constraints(CPO const& cpo, T&&... args) -> void { static_assert(test_std::sender(args)...))>); static_assert(test_std::sender_in(args)...))>); - static_assert( - std::same_as...)>, - beman::execution::detail::completion_signatures_for >); - static_assert( - std::same_as...)>, - decltype(beman::execution::get_completion_signatures(sender, test_std::empty_env{}))>); + static_assert(std::same_as...)>, + beman::execution::detail::completion_signatures_for>>); + static_assert(std::same_as...)>, + decltype(beman::execution::get_completion_signatures(sender, test_std::env<>{}))>); } } @@ -201,8 +199,8 @@ auto test_just_allocator() -> void { TEST(exec_just) { - using type = test_detail:: - call_result_t; + using type = + test_detail::call_result_t>; static_assert(std::same_as, type>); try { diff --git a/tests/beman/execution/exec-let.test.cpp b/tests/beman/execution/exec-let.test.cpp index 66e9e325..b110b194 100644 --- a/tests/beman/execution/exec-let.test.cpp +++ b/tests/beman/execution/exec-let.test.cpp @@ -55,7 +55,7 @@ auto test_let_value() { test_std::set_error_t(char)>(); })}; static_assert(test_std::sender); - using type = decltype(test_std::get_completion_signatures(s2, test_std::empty_env{})); + using type = decltype(test_std::get_completion_signatures(s2, test_std::env<>{})); static_assert(std::same_as); // static_assert(std::same_as); @@ -104,7 +104,7 @@ auto test_let_value_allocator() -> void { auto s{ex::just(std::span(values)) | ex::let_value(fun()) | ex::then([](auto&&) noexcept {})}; static_assert(test_std::sender); static_assert(test_std::sender_in); - // static_assert(std::same_as); + // static_assert(std::same_as{}))>); ex::sync_wait(s); } diff --git a/tests/beman/execution/exec-on.test.cpp b/tests/beman/execution/exec-on.test.cpp index bdb52797..c2a62ff0 100644 --- a/tests/beman/execution/exec-on.test.cpp +++ b/tests/beman/execution/exec-on.test.cpp @@ -44,13 +44,13 @@ auto test_interface(Sch sch, Sndr sndr, Closure closure, Both both) -> void { template OutSndr> auto test_transform_env(OutSndr out_sndr) -> void { - auto e{test_std::on.transform_env(out_sndr, test_std::empty_env{})}; + auto e{test_std::on.transform_env(out_sndr, test_std::env<>{})}; test::use(e); } template OutSndr> auto test_transform_sender(OutSndr out_sndr) -> void { - auto s{test_std::on.transform_sender(std::move(out_sndr), test_std::empty_env{})}; + auto s{test_std::on.transform_sender(std::move(out_sndr), test_std::env<>{})}; static_assert(test_std::sender); auto ts{std::move(s) | test_std::then([](auto&&...) {})}; static_assert(test_std::sender); diff --git a/tests/beman/execution/exec-prop.test.cpp b/tests/beman/execution/exec-prop.test.cpp index 7adbbff3..91fdecfc 100644 --- a/tests/beman/execution/exec-prop.test.cpp +++ b/tests/beman/execution/exec-prop.test.cpp @@ -30,11 +30,15 @@ auto test_prop(Env&& env, Value&& value) { }); ASSERT(test_query(env) == value); } + } // namespace TEST(exec_prop) { test_prop(env{}, 42); test_prop(test_std::prop(test_query, 42), 42); - [[maybe_unused]] auto p{test_std::prop(test_query, 2.5)}; - static_assert(not std::is_assignable_v); + auto p0{test_std::prop(test_query, 2.5)}; + decltype(p0) p1 = test_std::prop(test_query, 2.5); + [[maybe_unused]] decltype(p0) p2(p0); + static_assert(not std::is_assignable_v); + static_assert(not std::is_assignable_v>); } diff --git a/tests/beman/execution/exec-read-env.test.cpp b/tests/beman/execution/exec-read-env.test.cpp index 2ea2d7c5..4e2d5e28 100644 --- a/tests/beman/execution/exec-read-env.test.cpp +++ b/tests/beman/execution/exec-read-env.test.cpp @@ -69,7 +69,7 @@ auto test_read_env() -> void { auto test_read_env_completions() -> void { auto r{test_std::read_env(test_std::get_stop_token)}; test::check_type >( - test_std::get_completion_signatures(r, test_std::empty_env{})); + test_std::get_completion_signatures(r, test_std::env<>{})); test::use(r); } } // namespace diff --git a/tests/beman/execution/exec-snd-expos.test.cpp b/tests/beman/execution/exec-snd-expos.test.cpp index 25ae2f0b..31463a1a 100644 --- a/tests/beman/execution/exec-snd-expos.test.cpp +++ b/tests/beman/execution/exec-snd-expos.test.cpp @@ -389,7 +389,7 @@ auto test_query_with_default() -> void { static_assert(std::same_as); ASSERT(result1.value == 43); - auto result2{test_detail::query_with_default(test_std::get_domain, test_std::empty_env(), default_domain{74})}; + auto result2{test_detail::query_with_default(test_std::get_domain, test_std::env<>(), default_domain{74})}; static_assert(std::same_as); ASSERT(result2.default_value == 74); } @@ -459,7 +459,7 @@ auto test_get_domain_late() -> void { using sender_concept = test_std::sender_t; }; static_assert(test_std::sender); - test_get_domain_late(no_domain_sender{}, test_std::empty_env{}); + test_get_domain_late(no_domain_sender{}, test_std::env<>{}); struct scheduler_env { auto query(const test_std::get_scheduler_t&) const noexcept -> get_domain_late_scheduler { return {}; } @@ -486,7 +486,7 @@ auto test_get_domain_late() -> void { static_assert(std::same_as); static_assert( std::same_as); - test_get_domain_late(scheduler_sender{}, test_std::empty_env{}); + test_get_domain_late(scheduler_sender{}, test_std::env<>{}); struct env_sender { using sender_concept = test_std::sender_t; @@ -495,7 +495,7 @@ auto test_get_domain_late() -> void { static_assert(test_std::sender); static_assert(std::same_as); static_assert(std::same_as); - test_get_domain_late(env_sender{}, test_std::empty_env{}); + test_get_domain_late(env_sender{}, test_std::env<>{}); } auto test_default_impls_get_attrs() -> void { @@ -512,7 +512,7 @@ auto test_default_impls_get_attrs() -> void { static_assert(noexcept(test_detail::default_impls::get_attrs(0, child1{}))); static_assert( std::same_as, decltype(test_detail::default_impls::get_attrs(0, child1{}))>); - // static_assert(std::same_as, // decltype(test_detail::default_impls::get_attrs(0, child1{}, child2{}))>); } @@ -723,9 +723,9 @@ auto test_env_type() -> void { auto get_env() const noexcept -> local_env { return {}; } }; - static_assert(std::same_as, + static_assert(std::same_as>, test_detail::env_type>); - static_assert(std::same_as, + static_assert(std::same_as>, test_detail::env_type>); static_assert( std::same_as, test_detail::env_type>); @@ -1025,18 +1025,18 @@ auto test_completion_signatures_for() -> void { using empty_env_sigs = test_std::completion_signatures; using env_sigs = test_std::completion_signatures; - auto get_completion_signatures(const test_std::empty_env&) -> empty_env_sigs { return {}; } + auto get_completion_signatures(const test_std::env<>&) -> empty_env_sigs { return {}; } auto get_completion_signatures(const local_env&) -> env_sigs { return {}; } }; - static_assert(test_std::sender_in); + static_assert(test_std::sender_in>); static_assert(test_std::sender_in); static_assert(not test_std::sender_in); #if 0 //-dk:TODO restore completion_signatures_for tests static_assert(std::same_as< - test_detail::completion_signatures_for, + test_detail::completion_signatures_for>, sender::empty_env_sigs >); static_assert(std::same_as< @@ -1252,9 +1252,9 @@ auto test_write_env() -> void { static_assert(std::same_as, test_std::completion_signatures>); - static_assert(std::same_as, + static_assert(std::same_as>, test_std::completion_signatures>); - static_assert(std::same_as, + static_assert(std::same_as>, test_std::completion_signatures>); static_assert(test_std::sender_in); static_assert(std::same_as, diff --git a/tests/beman/execution/exec-spawn-future.test.cpp b/tests/beman/execution/exec-spawn-future.test.cpp index 17077fc3..af8f30a6 100644 --- a/tests/beman/execution/exec-spawn-future.test.cpp +++ b/tests/beman/execution/exec-spawn-future.test.cpp @@ -390,17 +390,17 @@ auto test_spawn_future() { ASSERT(handle != nullptr); ASSERT(result == 0); #if 0 - using type = typename beman::execution::detail::completion_signatures_for_impl::type; + using type = typename beman::execution::detail::completion_signatures_for_impl>::type; static_assert(std::same_as, type>); static_assert(std::same_as< test_std::completion_signatures, - decltype(test_std::get_completion_signatures(sndr, test_std::empty_env{})) + decltype(test_std::get_completion_signatures(sndr, test_std::env<>{})) >); #endif using exp_type = test_std::completion_signatures; - using comp_type = decltype(test_std::get_completion_signatures(std::move(sndr), test_std::empty_env{})); + using comp_type = decltype(test_std::get_completion_signatures(std::move(sndr), test_std::env<>{})); static_assert(test_detail::meta::contain_same); handle->complete(17); diff --git a/tests/beman/execution/exec-split.test.cpp b/tests/beman/execution/exec-split.test.cpp index bfa23796..1beb0619 100644 --- a/tests/beman/execution/exec-split.test.cpp +++ b/tests/beman/execution/exec-split.test.cpp @@ -118,13 +118,11 @@ struct NonCopyable { NonCopyable& operator=(const NonCopyable&) = delete; }; -struct empty_env {}; - void test_destroy_unused_split() { auto just = beman::execution::just(NonCopyable{}); auto split = beman::execution::split(std::move(just)); using split_sender_type = decltype(split); - static_assert(beman::execution::sender_in); + static_assert(beman::execution::sender_in>); } void test_destroy_two_unused_split() { @@ -132,7 +130,7 @@ void test_destroy_two_unused_split() { auto split = beman::execution::split(std::move(just)); auto copy = split; using split_sender_type = decltype(copy); - static_assert(beman::execution::sender_in); + static_assert(beman::execution::sender_in>); } using beman::execution::detail::type_list; @@ -146,7 +144,8 @@ void test_completion_sigs_and_sync_wait_on_split() { auto split = beman::execution::split(std::move(just)); using split_sender = std::decay_t; using expected_value_completions = type_list; - using value_completions = beman::execution::value_types_of_t; + using value_completions = + beman::execution::value_types_of_t, to_set_value_t, combine>; static_assert(std::same_as); auto eat_completion = beman::execution::then(split, [&](const NonCopyable&) {}); diff --git a/tests/beman/execution/exec-starts-on.test.cpp b/tests/beman/execution/exec-starts-on.test.cpp index ac530e17..5a13081d 100644 --- a/tests/beman/execution/exec-starts-on.test.cpp +++ b/tests/beman/execution/exec-starts-on.test.cpp @@ -66,7 +66,7 @@ auto test_use(Scheduler&& scheduler, Sender&& sender) -> void { auto s{test_std::starts_on(::std::forward(scheduler), ::std::forward(sender))}; test::use(s); // test::check_type(s); - // test::check_type(test_std::get_completion_signatures(s, test_std::empty_env{})); + // test::check_type(test_std::get_completion_signatures(s, test_std::test_std::env<>{})); test_std::sync_wait(std::move(s)); } } // namespace diff --git a/tests/beman/execution/exec-then.test.cpp b/tests/beman/execution/exec-then.test.cpp index 604d7022..b944efbb 100644 --- a/tests/beman/execution/exec-then.test.cpp +++ b/tests/beman/execution/exec-then.test.cpp @@ -80,7 +80,7 @@ auto test_has(auto cpo, auto in_sender, auto fun) -> void { template auto test_then_type(auto sender) { static_assert(std::same_as, - test_std::completion_signatures_of_t>); + test_std::completion_signatures_of_t>>); } auto test_then_type() -> void { diff --git a/tests/beman/execution/exec-utils-cmplsigs.test.cpp b/tests/beman/execution/exec-utils-cmplsigs.test.cpp index 79fe423a..ab77490f 100644 --- a/tests/beman/execution/exec-utils-cmplsigs.test.cpp +++ b/tests/beman/execution/exec-utils-cmplsigs.test.cpp @@ -38,7 +38,7 @@ struct sender { test_std::set_value_t(), test_std::set_value_t(arg<0>, arg<1>&, arg<2>&&, const arg<3>&), test_std::set_stopped_t()>; - auto get_completion_signatures(test_std::empty_env) const noexcept { return empty_signatures(); } + auto get_completion_signatures(test_std::env<>) const noexcept { return empty_signatures(); } using env_signatures = test_std::completion_signatures void { } auto test_value_types_of_t() -> void { - static_assert(test_std::sender_in); + static_assert(test_std::sender_in>); static_assert( - std::same_as>); + std::same_as>>); static_assert(test_std::sender_in); static_assert(std::same_as>); static_assert(test_std::sender_in); @@ -189,27 +189,27 @@ auto test_value_types_of_t() -> void { static_assert(std::same_as, std::tuple, arg<1>, arg<2>, arg<3>>>, test_std::value_types_of_t>); static_assert(std::same_as, std::tuple, arg<1>, arg<2>, arg<3>>>, - test_std::value_types_of_t>); + test_std::value_types_of_t>>); static_assert( std::same_as>, std::tuple>, std::tuple, arg<1>, arg<2>, arg<3>>>, test_std::value_types_of_t>); static_assert(std::same_as>); static_assert(std::same_as, tuple, arg<1>&, arg<2>&&, const arg<3>&>>, - test_std::value_types_of_t>); + test_std::value_types_of_t, tuple, variant>>); } auto test_error_types_of_t() -> void { - static_assert(test_std::sender_in); + static_assert(test_std::sender_in>); static_assert( - std::same_as>); + std::same_as>>); static_assert(test_std::sender_in); static_assert(std::same_as>); static_assert(test_std::sender_in); static_assert(std::same_as>); static_assert(std::same_as, test_std::error_types_of_t>); - static_assert(std::same_as, test_std::error_types_of_t>); + static_assert(std::same_as, test_std::error_types_of_t>>); static_assert(std::same_as, test_std::error_types_of_t>); static_assert(std::same_as>); static_assert( @@ -217,16 +217,16 @@ auto test_error_types_of_t() -> void { } auto test_sends_stopped() -> void { - static_assert(test_std::sender_in); + static_assert(test_std::sender_in>); static_assert( - std::same_as>); + std::same_as>>); static_assert(test_std::sender_in); static_assert(std::same_as>); static_assert(test_std::sender_in); static_assert(std::same_as>); static_assert(test_std::sends_stopped); - static_assert(test_std::sends_stopped); + static_assert(test_std::sends_stopped>); static_assert(test_std::sends_stopped); static_assert(not test_std::sends_stopped); } diff --git a/tests/beman/execution/exec-when-all.test.cpp b/tests/beman/execution/exec-when-all.test.cpp index f7dd6e9e..9eb848c2 100644 --- a/tests/beman/execution/exec-when-all.test.cpp +++ b/tests/beman/execution/exec-when-all.test.cpp @@ -43,7 +43,7 @@ auto test_when_all_breathing() -> void { auto s{test_std::when_all(test_std::just(), test_std::just(3, true), test_std::just(1.5))}; static_assert(test_std::sender); test::check_type>( - test_std::get_completion_signatures(s, test_std::empty_env{})); + test_std::get_completion_signatures(s, test_std::env<>{})); auto res{test_std::sync_wait(s)}; ASSERT(res.has_value()); ASSERT((*res == std::tuple{3, true, 1.5})); diff --git a/tests/beman/execution/execution-module.test.cpp b/tests/beman/execution/execution-module.test.cpp index 36d7361a..6645b50f 100644 --- a/tests/beman/execution/execution-module.test.cpp +++ b/tests/beman/execution/execution-module.test.cpp @@ -59,7 +59,7 @@ TEST(execution_modules) { //-dk:TODO test::use(test_stdex::get_forward_progress_guarantee); test::use(test_stdex::get_completion_scheduler); - test::use_type(); + test::use_type>(); test::use_type(); test::use(test_stdex::get_env); test::use_template(); @@ -108,7 +108,7 @@ TEST(execution_modules) { test_stdex::transform_sender(test_stdex::default_domain{}, test_stdex::just()); // [exec.snd.transform.env], environment transformations - //-dk:TODO test_stdex::transform_env(test_stdex::default_domain{}, test_stdex::just(), test_stdex::empty_env{}); + //-dk:TODO test_stdex::transform_env(test_stdex::default_domain{}, test_stdex::just(), test_stdex::env<>{}); // [exec.snd.apply], sender algorithm application //-dk:TODO test_stdex::apply_sender(test_stdex::default_domain{}, test_stdex::just_t{}, test_stdex::just()); diff --git a/tests/beman/execution/execution-syn.test.cpp b/tests/beman/execution/execution-syn.test.cpp index ac1fbfc0..32ef7faf 100644 --- a/tests/beman/execution/execution-syn.test.cpp +++ b/tests/beman/execution/execution-syn.test.cpp @@ -57,7 +57,7 @@ struct single_type_sender { test_std::set_error_t(int), test_std::set_value_t(bool&), test_std::set_stopped_t()>; - auto get_completion_signatures(const test_std::empty_env&) const noexcept { return empty_signatures(); } + auto get_completion_signatures(const test_std::env<>&) const noexcept { return empty_signatures(); } using no_value_signatures = test_std:: completion_signatures; auto get_completion_signatures(const no_value_env&) const noexcept { return no_value_signatures(); } @@ -113,7 +113,7 @@ auto test_env_of_t() -> void { auto get_env() const noexcept -> env { return {}; } }; - static_assert(std::same_as>); + static_assert(std::same_as, test_std::env_of_t>); static_assert(std::same_as>); } @@ -151,7 +151,7 @@ struct sender_with_get { using sender_concept = test_std::sender_t; using empty_sigs = test_std::completion_signatures; - auto get_completion_signatures(test_std::empty_env) const noexcept { return empty_sigs{}; } + auto get_completion_signatures(test_std::env<>) const noexcept { return empty_sigs{}; } using env_sigs = test_std::completion_signatures; auto get_completion_signatures(env) const noexcept { return env_sigs{}; } @@ -214,29 +214,27 @@ auto test_single_sender_value_type() -> void { static_assert(requires { typename test_detail::single_sender_value_type; }); static_assert( std::same_as>); - static_assert( - requires { typename test_detail::single_sender_value_type; }); - static_assert(std::same_as>); - static_assert(requires { typename test_detail::single_sender_value_type; }); - static_assert(std::same_as>); - static_assert( - requires { typename test_detail::single_sender_value_type; }); + static_assert(requires { typename test_detail::single_sender_value_type>; }); + static_assert(std::same_as>>); + static_assert(requires { typename test_detail::single_sender_value_type>; }); + static_assert(std::same_as>>); + static_assert(requires { typename test_detail::single_sender_value_type>; }); static_assert(std::same_as, - test_detail::single_sender_value_type>); - test_single_sender_value_type(single_type_sender{}, test_std::empty_env{}); + test_detail::single_sender_value_type>>); + test_single_sender_value_type(single_type_sender{}, test_std::env<>{}); test_single_sender_value_type(single_type_sender{}, test_env{}); test_single_sender_value_type(single_type_sender{}, no_value_env{}); - test_single_sender_value_type(multi_single_sender{}, test_std::empty_env{}); - test_single_sender_value_type(no_value_sender{}, test_std::empty_env{}); + test_single_sender_value_type(multi_single_sender{}, test_std::env<>{}); + test_single_sender_value_type(no_value_sender{}, test_std::env<>{}); } auto test_single_sender() -> void { - static_assert(test_detail::single_sender); + static_assert(test_detail::single_sender>); static_assert(test_detail::single_sender); - static_assert(test_detail::single_sender); - static_assert(not test_detail::single_sender); - static_assert(test_detail::single_sender); - static_assert(test_detail::single_sender); + static_assert(test_detail::single_sender>); + static_assert(not test_detail::single_sender>); + static_assert(test_detail::single_sender>); + static_assert(test_detail::single_sender>); } struct connect_sender { diff --git a/tests/beman/execution/non_assignable.test.cpp b/tests/beman/execution/non_assignable.test.cpp new file mode 100644 index 00000000..2b6f98d2 --- /dev/null +++ b/tests/beman/execution/non_assignable.test.cpp @@ -0,0 +1,18 @@ +// tests/beman/execution/non_assignable.test.cpp -*-C++-*- +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include +#include +#include + +// ---------------------------------------------------------------------------- + +auto main() -> int { + test_detail::non_assignable na0; + test_detail::non_assignable na1{}; + test_detail::non_assignable na2{na1}; + test_detail::non_assignable na3{test_detail::non_assignable{}}; + static_assert(not std::is_assignable_v); + static_assert(not std::is_assignable_v); + static_assert(not std::is_assignable_v); +} From a4af50c4a633f7a03715867e6b8b84d7d11e2cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Thu, 8 Jan 2026 23:51:29 +0000 Subject: [PATCH 2/2] it seems clang-17, clang-18 have some problem --- .github/workflows/ci_tests.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 6392abc1..c86fedb9 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -87,13 +87,6 @@ jobs: ] } ] - }, - { "versions": ["18", "17"], - "tests": [ - { "cxxversions": ["c++26", "c++23"], - "tests": [{"stdlibs": ["libc++"], "tests": ["Release.Default"]}] - } - ] } ], "msvc": [