Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix forwarding env #35

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Changes from 1 commit
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
Next Next commit
fix a few issues around dealing with environments
dietmarkuehl committed Sep 20, 2024
commit 71b2a3f5b820ecb71403a266497bddaf36206c59
4 changes: 1 addition & 3 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -3,9 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# cmake-format: on

set(BEMAN_EXECUTION26_LIBRARY beman_execution26)

include(GNUInstallDirs)
set(BEMAN_EXECUTION26_LIBRARY beman_${TARGET_NAME})

set(EXAMPLES
stop_token
10 changes: 10 additions & 0 deletions include/beman/execution26/detail/common.hpp
Original file line number Diff line number Diff line change
@@ -25,4 +25,14 @@

// ----------------------------------------------------------------------------

namespace beman::execution26::detail
{
template <typename...> struct fail_type;
template <typename...T>
auto fail(T&&...) { fail_type<T...>{}; }
auto use(auto&&...) noexcept -> void {}
}

// ----------------------------------------------------------------------------

#endif
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
namespace beman::execution26
{
template <typename Sender, typename Env = ::beman::execution26::empty_env>
requires ::beman::execution26::sender_in<Sender>
requires ::beman::execution26::sender_in<Sender, Env>
using completion_signatures_of_t
= ::beman::execution26::detail::call_result_t<
::beman::execution26::get_completion_signatures_t, Sender, Env
3 changes: 2 additions & 1 deletion include/beman/execution26/detail/fwd_env.hpp
Original file line number Diff line number Diff line change
@@ -28,12 +28,13 @@ namespace beman::execution26::detail
= BEMAN_EXECUTION26_DELETE("the used query is not forwardable");

template <typename Query, typename... Args>
requires (::beman::execution26::forwarding_query(::std::remove_cvref_t<Query>()))
requires(::beman::execution26::forwarding_query(::std::remove_cvref_t<Query>()))
&& requires(Env const& env, Query&& q, Args&&... args)
{
env.query(q, ::std::forward<Args>(args)...);
}
constexpr auto query(Query&& q, Args&&... args) const
noexcept(noexcept(env.query(q, ::std::forward<Args>(args)...)))
{
return env.query(q, ::std::forward<Args>(args)...);
}
1 change: 0 additions & 1 deletion include/beman/execution26/detail/into_variant.hpp
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@
#include <beman/execution26/detail/make_sender.hpp>
#include <beman/execution26/detail/meta_combine.hpp>
#include <beman/execution26/detail/sender.hpp>
#include <beman/execution26/detail/sender_in.hpp>
#include <beman/execution26/detail/sends_stopped.hpp>
#include <beman/execution26/detail/set_error.hpp>
#include <beman/execution26/detail/set_value.hpp>
2 changes: 1 addition & 1 deletion src/beman/execution26/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cmake-format: off
# src/beman/${TARGET_NAME}/CMakeLists.txt -*-makefile-*-
# src/beman/execution26/CMakeLists.txt -*-makefile-*-
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# cmake-format: on