Commit ff3c5f9c authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Tweaks to Futures after D9015012

Summary:
[Folly] Tweaks to Futures after {D9015012}.

* Publish base-class methods with `using`.
* Use trailing-comma in list initializers.

Reviewed By: shixiao

Differential Revision: D9024885

fbshipit-source-id: d1e548630152a7d7ce892084daef24a4e62dd0df
parent a31665e0
......@@ -550,6 +550,7 @@ class SemiFuture : private futures::detail::FutureBase<T> {
/* implicit */ SemiFuture(Future<T>&&) noexcept;
using Base::cancel;
using Base::getPriority;
using Base::hasException;
using Base::hasValue;
using Base::isReady;
......@@ -839,11 +840,6 @@ class SemiFuture : private futures::detail::FutureBase<T> {
/// - `RESULT.valid() == true`
Future<T> toUnsafeFuture() &&;
/// Return this future's executor priority.
int8_t getPriority() const {
return Base::getPriority();
}
#if FOLLY_HAS_COROUTINES
class promise_type {
public:
......@@ -1039,15 +1035,16 @@ class Future : private futures::detail::FutureBase<T> {
Future& operator=(Future<T2>&&);
using Base::cancel;
using Base::getPriority;
using Base::hasException;
using Base::hasValue;
using Base::isReady;
using Base::poll;
using Base::raise;
using Base::result;
using Base::setCallback_;
using Base::valid;
using Base::value;
using Base::result;
/// Creates/returns an invalid Future, that is, one with no shared state.
///
......@@ -1822,11 +1819,6 @@ class Future : private futures::detail::FutureBase<T> {
return SemiFuture<T>{std::move(*this)};
}
// Returns this future's executor priority.
int8_t getPriority() const {
return Base::getPriority();
}
protected:
friend class Promise<T>;
template <class>
......
......@@ -176,9 +176,11 @@ TEST(FutureSplitter, splitFutureFailure) {
}
TEST(FutureSplitter, splitFuturePriority) {
std::vector<int8_t> priorities = {folly::Executor::LO_PRI,
folly::Executor::MID_PRI,
folly::Executor::HI_PRI};
std::vector<int8_t> priorities = {
folly::Executor::LO_PRI,
folly::Executor::MID_PRI,
folly::Executor::HI_PRI,
};
for (const auto priority : priorities) {
Promise<int> p;
......
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