Commit fe13e6a5 authored by Lee Howes's avatar Lee Howes Committed by Facebook Github Bot

Remove member function pointer Future::then with keepalive

Summary: As part of simplifying and removing ambiguity in the interface this removes the form of then(KeepAlive, member-function-pointer). Removing this directly removes the need to make multiple overloads, and migrating to a cleaner then(KeepAlive,...) form will delegate this to the application of the nested continuation.

Reviewed By: yfeldblum

Differential Revision: D15059814

fbshipit-source-id: 8e4481cc471b4ed2dc578c52e26f2223c2468719
parent 7e63ae17
......@@ -1188,17 +1188,6 @@ class Future : private futures::detail::FutureBase<T> {
.via(std::move(oldX));
}
template <class R, class Caller, class... Args>
auto then(
Executor::KeepAlive<> x,
R (Caller::*func)(Args...),
Caller* instance) && {
auto oldX = getKeepAliveToken(this->getExecutor());
this->setExecutor(std::move(x));
return std::move(*this).then(func, instance).via(std::move(oldX));
}
/// When this Future has completed, execute func which is a function that
/// can be called with `Try<T>&&` (often a lambda with parameter type
/// `auto&&` or `auto`).
......
......@@ -296,21 +296,6 @@ TEST(Via, then2) {
EXPECT_TRUE(c);
}
TEST(Via, then2Variadic) {
struct Foo {
bool a = false;
void foo(Try<Unit>) {
a = true;
}
};
Foo f;
ManualExecutor x;
makeFuture().then(&x, &Foo::foo, &f);
EXPECT_FALSE(f.a);
x.run();
EXPECT_TRUE(f.a);
}
#ifndef __APPLE__ // TODO #7372389
/// Simple executor that does work in another thread
class ThreadExecutor : public 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