execute callbacks as rvalue references
Summary:
Callable objects may implement a separate `operator()` for when
they are called as rvalue references. For example, `folly::partial`
will move captured objects to the function call when invoked as
rvalue reference. That allows e.g. to capture pass a `unique_ptr`
to `folly::partial` for a function that takes a `unique_ptr` by
value or rvalue-reference.
Callbacks for `folly::Future`s are only ever executed once. They
may consume captured data. If the callback is an object that
implements a `operator()() &&`, then that one should be invoked.
This diff makes sure, callbacks passed to `folly::Future` are
invoked as rvalue references.
Reviewed By: ericniebler, fugalh
Differential Revision:
D4404186
fbshipit-source-id:
9f33e442a634acb8797183d3d869840d85bd5d15