-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathreceiver.hpp
34 lines (27 loc) · 1.19 KB
/
receiver.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// include/beman/execution26/detail/receiver.hpp -*-C++-*-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef INCLUDED_BEMAN_EXECUTION26_DETAIL_RECEIVER
#define INCLUDED_BEMAN_EXECUTION26_DETAIL_RECEIVER
#include <beman/execution26/detail/queryable.hpp>
#include <beman/execution26/detail/get_env.hpp>
#include <concepts>
#include <type_traits>
// ----------------------------------------------------------------------------
namespace beman::execution26
{
struct receiver_t {};
template <typename Rcvr>
concept receiver
= ::std::derived_from<typename ::std::remove_cvref_t<Rcvr>::receiver_concept,
::beman::execution26::receiver_t>
&& requires(::std::remove_cvref_t<Rcvr> const& rcvr)
{
{ ::beman::execution26::get_env(rcvr) } -> ::beman::execution26::detail::queryable;
}
&& ::std::move_constructible<::std::remove_cvref_t<Rcvr>>
&& ::std::constructible_from<::std::remove_cvref_t<Rcvr>, Rcvr>
&& (not ::std::is_final_v<::std::remove_cvref_t<Rcvr>>)
;
}
// ----------------------------------------------------------------------------
#endif