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

Add deprecation of l-value form of Future<T>::then()

Summary:
Separates l-value and r-value versions of parameterless then.

Deprecates l-value version.

Reviewed By: yfeldblum

Differential Revision: D9222345

fbshipit-source-id: 3dd95b3e35bf1b06d426334c30150b049a5e0b70
parent e34ba846
......@@ -1127,7 +1127,7 @@ Future<T> Future<T>::thenError(F&& func) && {
}
template <class T>
Future<Unit> Future<T>::then() {
Future<Unit> Future<T>::then() && {
return std::move(*this).then([]() {});
}
......
......@@ -1375,7 +1375,12 @@ 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`
Future<Unit> then();
Future<Unit> then() &&;
[[deprecated("must be rvalue-qualified, e.g., std::move(future).then()")]]
Future<Unit> then() & {
return std::move(*this).then();
}
/// Convenience method for ignoring the value and creating a Future<Unit>.
/// Exceptions still propagate.
......
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