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

reenable (but deprecate) lvalue-qual Future::onError()

Summary: Per T33416893, D9441402 caused a regression in FB4A. Goal: reenable lvalue-qual Future::onError(). Make it deprecated to minimize the chances of anyone creating new callsites.

Reviewed By: yfeldblum

Differential Revision: D9597490

fbshipit-source-id: 9c6a34c37c8f576e2497164bd440cdbc3565920d
parent 4d0ee00c
...@@ -1476,6 +1476,14 @@ class Future : private futures::detail::FutureBase<T> { ...@@ -1476,6 +1476,14 @@ class Future : private futures::detail::FutureBase<T> {
Future<T>>::type Future<T>>::type
onError(F&& func) &&; onError(F&& func) &&;
// clang-format off
template <class F>
[[deprecated("use rvalue-qualified fn, eg, std::move(future).onError(...)")]]
Future<T> onError(F&& func) & {
return std::move(*this).onError(std::forward<F>(func));
}
// clang-format on
/// func is like std::function<void()> and is executed unconditionally, and /// func is like std::function<void()> and is executed unconditionally, and
/// the value/exception is passed through to the resulting Future. /// the value/exception is passed through to the resulting Future.
/// func shouldn't throw, but if it does it will be captured and propagated, /// func shouldn't throw, but if it does it will be captured and propagated,
......
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