Commit 451819f6 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

tweaks to futures interrupts

Summary:
* Always copy or move the interrupt handler precisely once.
* Mark interrupt-handler heap classes as final to help the compiler devirtualize, even though it should already be able to.

Reviewed By: davidtgoldblatt

Differential Revision: D29974764

fbshipit-source-id: d39008fa4d1a37fb448d42063da907edc08aa328
parent 3e84bbd6
......@@ -193,9 +193,12 @@ class InterruptHandler {
};
template <class F>
class InterruptHandlerImpl : public InterruptHandler {
class InterruptHandlerImpl final : public InterruptHandler {
public:
explicit InterruptHandlerImpl(F f) : f_(std::move(f)) {}
template <typename R>
explicit InterruptHandlerImpl(R&& f) noexcept(
noexcept(F(static_cast<R&&>(f))))
: f_(static_cast<R&&>(f)) {}
void handle(const folly::exception_wrapper& ew) const override { f_(ew); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment