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

Check then callability using tryCallableResult as it forwards to thenTry anyway

Summary: Switch to the correct callability check to match the internals. Without this change then is ambiguous and can still generate errors on polymorphic lambdas.

Reviewed By: yfeldblum

Differential Revision: D15147830

fbshipit-source-id: 3f577641495a24076e9ffa19deaad190452c420c
parent 67210f1c
......@@ -1116,11 +1116,9 @@ class Future : private futures::detail::FutureBase<T> {
/// - Calling code should act as if `valid() == false`,
/// i.e., as if `*this` was moved into RESULT.
/// - `RESULT.valid() == true`
template <typename F, typename R = futures::detail::callableResult<T, F>>
typename std::enable_if<
!is_invocable<F, T&&>::value && !is_invocable<F>::value,
typename R::Return>::type
then(F&& func) && {
template <typename F>
Future<typename futures::detail::tryCallableResult<T, F>::value_type> then(
F&& func) && {
return std::move(*this).thenTry(std::forward<F>(func));
}
......
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