proxygen
just.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
21 
22 namespace folly {
23 namespace pushmi {
24 
25 namespace operators {
26 
27 PUSHMI_INLINE_VAR constexpr struct just_fn {
28  private:
29  struct sender_base : single_sender<ignoreSF, inlineEXF> {
30  using properties = property_set<
35  };
36  template <class... VN>
37  struct impl {
38  std::tuple<VN...> vn_;
39  PUSHMI_TEMPLATE(class Out)
40  (requires ReceiveValue<Out, VN...>)
41  void operator()(sender_base&, Out out) {
44  std::tuple_cat(std::tuple<Out&>{out}, std::move(vn_)));
45  set_done(std::move(out));
46  }
47  };
48 
49  public:
50  PUSHMI_TEMPLATE(class... VN)
51  (requires And<SemiMovable<VN>...>)
52  auto operator()(VN... vn) const {
53  return make_single_sender(
54  sender_base{}, impl<VN...>{std::tuple<VN...>{std::move(vn)...}});
55  }
56 } just{};
57 } // namespace operators
58 
59 } // namespace pushmi
60 } // namespace folly
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
#define PUSHMI_INLINE_VAR
Definition: concept_def.h:60
requires requires(detail::apply_impl(std::declval< F >(), std::declval< Tuple >(), detail::tupidxs< Tuple >{}))) const expr decltype(auto) apply(F &&f
PUSHMI_TEMPLATE(class E=std::exception_ptr, class Wrapped)(requires Sender< detail
Definition: executor.h:102
PUSHMI_INLINE_VAR constexpr __adl::set_value_fn set_value
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::operators::just_fn just
decltype(auto) constexpr apply(F &&func, Tuple &&tuple)
Definition: ApplyTuple.h:87
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::make_single_sender_fn make_single_sender
PUSHMI_INLINE_VAR constexpr __adl::set_done_fn set_done