31 template <
class E,
class... VN>
38 template <
class Wrapped>
55 static constexpr vtable
const noop_{};
57 template <
class T,
class U = std::decay_t<T>>
59 template <
class Wrapped>
62 ReceiveValue<Wrapped, VN...>,
63 "Wrapped receiver must support values of type VN...");
65 ReceiveError<Wrapped, std::exception_ptr>,
66 "Wrapped receiver must support std::exception_ptr and be noexcept");
69 "Wrapped receiver must support E and be noexcept");
71 template <
class Wrapped>
77 delete static_cast<Wrapped
const*
>(src.pobj_);
80 set_done(*static_cast<Wrapped*>(src.pobj_));
93 template <
class Wrapped>
99 Wrapped(
std::move(*static_cast<Wrapped*>((
void*)src.buffer_)));
100 static_cast<Wrapped
const*
>((
void*)src.buffer_)->~Wrapped();
103 set_done(*static_cast<Wrapped*>((
void*)src.buffer_));
126 (
requires ReceiveValue<wrapped_t<Wrapped>, VN...>&& ReceiveError<
134 vptr_->op_(
data_,
nullptr);
144 vptr_->value_(
data_, (VN &&) vn...);
162 template <
class E,
class... VN>
166 template <
class VF,
class EF,
class DF>
177 !detail::is_v<VF, on_error_fn>,
178 "the first parameter is the value implementation, but on_error{} was passed");
180 !detail::is_v<EF, on_value_fn>,
181 "the second parameter is the error implementation, but on_value{} was passed");
183 NothrowInvocable<EF&, std::exception_ptr>,
184 "error function must be noexcept and support std::exception_ptr");
213 static_assert(NothrowInvocable<EF&, E>,
"error function must be noexcept");
243 !detail::is_v<DVF, on_error_fn>,
244 "the first parameter is the value implementation, but on_error{} was passed");
246 !detail::is_v<DEF, on_value_fn>,
247 "the second parameter is the error implementation, but on_value{} was passed");
249 Invocable<DEF, Data&, std::exception_ptr>,
250 "error function must support std::exception_ptr");
252 NothrowInvocable<DEF, Data&, std::exception_ptr>,
253 "error function must be noexcept");
260 : receiver(
std::
move(d), DVF{}, DEF{}, DDF{}) {}
262 : done_(false), data_(
std::
move(d)), vf_(), ef_(), df_(df) {}
277 vf_(data_, (VN &&) vn...);
281 (
requires Invocable<DEF&, Data&, E>)
284 NothrowInvocable<DEF&, Data&, E>,
"error function must be noexcept");
321 auto operator()(VF vf)
const {
324 template <
class... EFN>
328 template <
class... DFN>
337 not lazy::Invocable<EF&>)))
338 auto operator()(VF vf, EF ef)
const {
346 auto operator()(EF ef, DF df)
const {
354 auto operator()(VF vf, EF
ef, DF df)
const {
360 lazy::ReceiverDataArg<Data>))
361 auto operator()(Data d)
const {
367 lazy::ReceiverDataArg<Data>))
368 auto operator()(Data d, DVF vf)
const {
374 lazy::ReceiverDataArg<Data>))
381 lazy::ReceiverDataArg<Data>))
388 lazy::ReceiverDataArg<Data>))
395 lazy::ReceiverDataArg<Data>))
403 lazy::Invocable<DDF&, Data&>))
404 auto operator()(Data d, DVF vf, DEF
ef, DDF df)
const {
411 #if __cpp_deduction_guides >= 201703 420 template <
class... EFN>
423 template <
class... DFN>
431 not lazy::Invocable<EF&>)))
451 lazy::ReceiverDataArg<Data>))
457 lazy::ReceiverDataArg<Data>))
463 lazy::ReceiverDataArg<Data>))
470 lazy::ReceiverDataArg<Data>))
477 lazy::ReceiverDataArg<Data>))
483 lazy::ReceiverDataArg<Data>
491 lazy::Invocable<DDF&, Data&>))
502 auto result = p.get_future();
509 std::promise<void> p;
510 auto result = p.get_future();
constexpr receiver(Data d, DEF ef, DDF df=DDF{})
any_receiver(Wrapped obj, std::true_type) noexcept
static constexpr bool insitu() noexcept
static void s_done(data &)
constexpr receiver(VF vf, EF ef, DF df=DF{})
auto operator()(on_done_fn< DFN... > df) const
constexpr receiver(Data d, DVF vf, DEF ef=DEF{}, DDF df=DDF{})
any_receiver(any_receiver &&that) noexcept
constexpr detail::Map< Move > move
any_receiver & operator=(any_receiver &&that) noexcept
union folly::pushmi::any_receiver::data data_
PUSHMI_INLINE_VAR constexpr __adl::set_error_fn set_error
property_set_insert_t< properties_t< Data >, property_set< is_receiver<>>> properties
—— Concurrent Priority Queue Implementation ——
requires E e noexcept(noexcept(s.error(std::move(e))))
requires And< SemiMovable< VN >... > &&SemiMovable< E > auto error(E e)
typename std::enable_if_t< PropertySet< PS0 > &&PropertySet< PS1 >, detail::property_set_insert< PS0, PS1 >>::type property_set_insert_t
bool_constant< true > true_type
static void s_error(data &, E) noexcept
constexpr receiver(DF df)
constexpr receiver(EF ef)
PUSHMI_CONCEPT_DEF(template(class PS) concept Cardinality, has_cardinality_v< PS >)
constexpr auto data(C &c) -> decltype(c.data())
requires Invocable< VF &, VN... > void value(VN &&...vn)
requires SenderTo< In, std::promise< T >, is_single<> > std::future< T > future_from(In in)
requires ReceiveValue< wrapped_t< Wrapped >, VN... > &&ReceiveError< Wrapped, E > any_receiver(Wrapped obj) noexcept(insitu< Wrapped >())
static void s_value(data &, VN...)
static const char *const value
static void s_op(data &, data *)
auto operator()(on_error_fn< EFN... > ef) const
#define PUSHMI_INLINE_VAR
std::integral_constant< bool, B > bool_
requires requires(detail::apply_impl(std::declval< F >(), std::declval< Tuple >(), detail::tupidxs< Tuple >{}))) const expr decltype(auto) apply(F &&f
requires Invocable< EF &, E > void error(E e) noexcept
T exchange(T &obj, U &&new_value)
PUSHMI_TEMPLATE(class E=std::exception_ptr, class Wrapped)(requires Sender< detail
requires PUSHMI_EXP(lazy::True<> PUSHMI_BROKEN_SUBSUMPTION(PUSHMI_AND not lazy::ReceiverDataArg< VF >))) auto operator()(VF vf) const
void(* op_)(data &, data *)
any_receiver(Wrapped obj, std::false_type)
PUSHMI_INLINE_VAR constexpr __adl::set_value_fn set_value
std::enable_if_t<!std::is_same< U, any_receiver >::value, U > wrapped_t
requires Invocable< DEF &, Data &, E > void error(E e) noexcept
bool_constant< false > false_type
#define PUSHMI_TYPE_CONSTRAINT(...)
char buffer_[sizeof(std::promise< int >)]
constexpr receiver(EF ef, DF df)
PUSHMI_INLINE_VAR constexpr __adl::do_submit_fn submit
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
requires Invocable< DVF &, Data &, VN... > void value(VN &&...vn)
constexpr receiver(Data d)
constexpr receiver(VF vf)
#define PUSHMI_BROKEN_SUBSUMPTION(...)
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::make_receiver_fn make_receiver
requires PUSHMI_EXP(lazy::True<> PUSHMI_AND lazy::ReceiverDataArg< Data >)) auto operator()(Data d) const
constexpr receiver(Data d, DDF df)
static constexpr vtable const noop_
PUSHMI_INLINE_VAR constexpr __adl::set_done_fn set_done