diff options
Diffstat (limited to 'src/mongo/util/future.h')
-rw-r--r-- | src/mongo/util/future.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/util/future.h b/src/mongo/util/future.h index c32731c1986..3ad43982591 100644 --- a/src/mongo/util/future.h +++ b/src/mongo/util/future.h @@ -1710,8 +1710,8 @@ inline auto makePromiseFuture() { * FutureContinuationResult<std::function<int(bool)>, NotBool> SFINAE-safe substitution failure. */ template <typename Func, typename... Args> -using FutureContinuationResult = - typename future_details::FutureContinuationResultImpl<std::result_of_t<Func(Args&&...)>>::type; +using FutureContinuationResult = typename future_details::FutureContinuationResultImpl< + std::invoke_result_t<Func, Args&&...>>::type; // // Implementations of methods that couldn't be defined in the class due to ordering requirements. @@ -1719,12 +1719,14 @@ using FutureContinuationResult = template <typename T> inline Future<T> Promise<T>::getFuture() noexcept { + using namespace future_details; _sharedState->threadUnsafeIncRefCountTo(2); return Future<T>(boost::intrusive_ptr<SharedState<T>>(_sharedState.get(), /*add ref*/ false)); } template <typename T> inline void Promise<T>::setFrom(Future<T>&& future) noexcept { + using namespace future_details; setImpl([&](boost::intrusive_ptr<SharedState<T>>&& sharedState) { future.propagateResultTo(sharedState.get()); }); @@ -1743,6 +1745,7 @@ template <typename T> template <typename T> inline SharedSemiFuture<T> Future<T>::share() && noexcept { + using namespace future_details; if (!_immediate) return SharedSemiFuture<T>(std::move(_shared)); |