Commit 56fae0e5 authored by Marshall Cline's avatar Marshall Cline Committed by Facebook Github Bot

remove lvalue-qual Future::thenMultiWithExecutor(...)

Summary:
This is part of "the great r-valuification of folly::Future":
* This is something we should do for safety in general.
* Several of folly::Future's methods are lvalue-qualified even though they act as though they are rvalue-qualified, that is, they provide a postcondition that says, in effect, callers should act as though the method invalidated its `this` object (regardless of whether that invalidation was actual or logical).
* This violates the C++ principle to "Express ideas directly in code" (see Core Guidelines), and generally makes it more confusing for callers as well as hiding the actual semantics from tools (linters, compilers, etc.).
* This dichotomy and confusion has manifested itself by some failures around D7840699 since lvalue-qualification hides that operation's move-out semantics - leads to some use of future operations that are really not correct, but are not obviously incorrect.
* The goal of rvalueification is to make sure methods that are logically rvalue-qualified are actually rvalue-qualified, which forces callsites to acknowledge that rvalueification, e.g., `std::move(f).thenMulti(...)` instead of `f.thenMulti(...)`. This syntactic change in the callsites forces callers to acknowledge the method's rvalue semantics.

Reviewed By: LeeHowes

Differential Revision: D9437767

fbshipit-source-id: f40d0660a50ccfec1040e42c8028efde956a4b48
parent 1de92cd7
......@@ -1862,18 +1862,6 @@ class Future : private futures::detail::FutureBase<T> {
return std::move(*this).then(x, std::forward<Callback>(fn));
}
template <class Callback, class... Callbacks>
auto thenMultiWithExecutor(Executor* x, Callback&& fn, Callbacks&&... fns) & {
return std::move(*this).themMultiWithExecutor(
x, std::forward<Callback>(fn), std::forward<Callbacks>(fns)...);
}
template <class Callback>
auto thenMultiWithExecutor(Executor* x, Callback&& fn) & {
return std::move(*this).themMultiWithExecutor(
x, std::forward<Callback>(fn));
}
/// Moves-out `*this`, creating/returning a corresponding SemiFuture.
/// Result will behave like `*this` except result won't have an Executor.
///
......
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