proxygen
no_fail.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 
20 
21 namespace folly {
22 namespace pushmi {
23 
24 namespace detail {
25 
26 struct no_fail_fn {
27  private:
28  struct on_error_impl {
29  [[noreturn]] void operator()(any, any) noexcept {
30  std::abort();
31  }
32  };
33  template <class In>
34  struct out_impl {
35  PUSHMI_TEMPLATE(class Out)
36  (requires Receiver<Out>)auto operator()(Out out) const {
37  return ::folly::pushmi::detail::receiver_from_fn<In>()(
39  }
40  };
41  struct in_impl {
42  PUSHMI_TEMPLATE(class In)
43  (requires Sender<In>)auto operator()(In in) const {
45  std::move(in),
46  ::folly::pushmi::detail::submit_transform_out<In>(out_impl<In>{}));
47  }
48  };
49 
50  public:
51  auto operator()() const {
52  return in_impl{};
53  }
54 };
55 
56 } // namespace detail
57 
58 namespace operators {
60 } // namespace operators
61 
62 } // namespace pushmi
63 } // namespace folly
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
auto on_error(Fns...fns) -> on_error_fn< Fns... >
Definition: boosters.h:273
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
requires E e noexcept(noexcept(s.error(std::move(e))))
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 struct folly::pushmi::detail::sender_from_fn sender_from
PUSHMI_TEMPLATE(class In, class Out, bool SenderRequires, bool SingleSenderRequires, bool TimeSingleSenderRequires)(requires Sender< In > &&Receiver< Out >) constexpr bool sender_requires_from()
PUSHMI_INLINE_VAR constexpr detail::no_fail_fn no_fail
Definition: no_fail.h:59