|
| 1 | +// include/beman/execution/detail/sender_to.hpp -*-C++-*- |
| 2 | +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 3 | + |
| 4 | +#ifndef INCLUDED_BEMAN_EXECUTION_DETAIL_SENDER_TO |
| 5 | +#define INCLUDED_BEMAN_EXECUTION_DETAIL_SENDER_TO |
| 6 | + |
| 7 | +#ifdef BEMAN_HAS_IMPORT_STD |
| 8 | +import std; |
| 9 | +#else |
| 10 | +#include <utility> |
| 11 | +#endif |
| 12 | +#include <beman/execution/detail/common.hpp> |
| 13 | +#ifdef BEMAN_HAS_MODULES |
| 14 | +import beman.execution.detail.completion_signatures_of_t; |
| 15 | +import beman.execution.detail.connect; |
| 16 | +import beman.execution.detail.env_of_t; |
| 17 | +import beman.execution.detail.receiver_of; |
| 18 | +import beman.execution.detail.sender_in; |
| 19 | +#else |
| 20 | +#include <beman/execution/detail/completion_signatures_of_t.hpp> |
| 21 | +#include <beman/execution/detail/connect.hpp> |
| 22 | +#include <beman/execution/detail/env_of_t.hpp> |
| 23 | +#include <beman/execution/detail/receiver_of.hpp> |
| 24 | +#include <beman/execution/detail/sender_in.hpp> |
| 25 | +#endif |
| 26 | + |
| 27 | +// ---------------------------------------------------------------------------- |
| 28 | + |
| 29 | +namespace beman::execution { |
| 30 | +template <typename Sender, typename Receiver> |
| 31 | +concept sender_to = |
| 32 | + ::beman::execution::sender_in<Sender, ::beman::execution::env_of_t<Receiver>> && |
| 33 | + ::beman::execution::receiver_of< |
| 34 | + Receiver, |
| 35 | + ::beman::execution::completion_signatures_of_t<Sender, ::beman::execution::env_of_t<Receiver>>> && |
| 36 | + requires(Sender&& sndr, Receiver&& rcvr) { |
| 37 | + ::beman::execution::connect(::std::forward<Sender>(sndr), ::std::forward<Receiver>(rcvr)); |
| 38 | + }; |
| 39 | +} // namespace beman::execution |
| 40 | + |
| 41 | +// ---------------------------------------------------------------------------- |
| 42 | + |
| 43 | +#endif // INCLUDED_BEMAN_EXECUTION_DETAIL_SENDER_TO |
0 commit comments