Summary:
This diff changes the definition of `folly::Func` from `std::function<void()>`
over to `folly::Function<void()>`. This mostly affects the interface of
`folly::Executor` and derived and related classes. By using
`folly::Function<void()>`, we allow to have lambdas capturing move-only types
passed to executors. This continues an effort to get rid of the potentially
dangerous `folly::MoveWrapper` by allowing to capture move-only types in lambdas
when using `folly::Future`, `folly::EventBase` and now `folly::Executor`.
Reviewed By: yfeldblum
Differential Revision:
D3706449
fbshipit-source-id:
11c2cee32cb9f0298c39b7b1695a477777eeb3aa
#include <functional>
#include <stdexcept>
+#include <folly/Function.h>
+
namespace folly {
-typedef std::function<void()> Func;
+using Func = Function<void()>;
/// An Executor accepts units of work with add(), which should be
/// threadsafe.