21 template <
class T,
class BatonT>
23 : value_(&value), baton_(&baton) {}
25 template <
class T,
class BatonT>
28 other.value_ =
nullptr;
29 other.baton_ =
nullptr;
32 template <
class T,
class BatonT>
39 template <
class T,
class BatonT>
42 throw std::logic_error(
"promise already fulfilled");
46 template <
class T,
class BatonT>
49 setException(folly::make_exception_wrapper<std::logic_error>(
50 "promise not fulfilled"));
54 template <
class T,
class BatonT>
59 template <
class T,
class BatonT>
71 template <
class T,
class BatonT>
79 template <
class T,
class BatonT>
86 template <
class T,
class BatonT>
92 template <
class T,
class BatonT>
96 std::exception_ptr funcException;
99 baton.wait([&func, &result, &baton, &funcException]()
mutable {
105 funcException = std::current_exception();
109 if (
UNLIKELY(funcException !=
nullptr)) {
110 std::rethrow_exception(funcException);
void setTry(folly::Try< T > &&t)
constexpr detail::Map< Move > move
—— Concurrent Priority Queue Implementation ——
requires E e noexcept(noexcept(s.error(std::move(e))))
void setException(folly::exception_wrapper)
static const char *const value
**Optimized Holders **The template hazptr_array< M > provides most of the functionality *of M hazptr_holder s but with faster construction destruction *for M
Promise(const Promise &)=delete
std::enable_if< !std::is_same< invoke_result_t< F >, void >::value, Try< invoke_result_t< F > > >::type makeTryWith(F &&f)
void throwIfFulfilled() const
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
static value_type await(F &&func)
Promise & operator=(const Promise &)=delete