proxygen
share.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 
23 
24 namespace folly {
25 namespace pushmi {
26 
27 namespace detail {
28 
29 template <class... TN>
30 struct share_fn {
31  private:
32  struct impl {
33  PUSHMI_TEMPLATE(class In)
34  (requires Sender<In>)
35  auto operator()(In in) const {
37  submit(in, sub.receiver());
38  return sub;
39  }
40  };
41 
42  public:
43  auto operator()() const {
44  return impl{};
45  }
46 };
47 
48 } // namespace detail
49 
50 namespace operators {
51 
52 template <class... TN>
54 
55 } // namespace operators
56 
57 } // namespace pushmi
58 } // namespace folly
Sub sub(Sink sink)
Definition: Parallel.h:104
PUSHMI_INLINE_VAR constexpr detail::share_fn< TN... > share
Definition: share.h:53
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
requires requires(::folly::pushmi::invoke(std::declval< F >(), std::get< Is >(std::declval< Tuple >())...))) const expr decltype(auto) apply_impl(F &&f
#define PUSHMI_INLINE_VAR
Definition: concept_def.h:60
PUSHMI_INLINE_VAR constexpr __adl::do_submit_fn submit
PUSHMI_TEMPLATE(class In, class Out, bool SenderRequires, bool SingleSenderRequires, bool TimeSingleSenderRequires)(requires Sender< In > &&Receiver< Out >) constexpr bool sender_requires_from()
auto operator()() const
Definition: share.h:43