From 330c83f8c116bd45316397b179275e9d87007e7d Mon Sep 17 00:00:00 2001 From: Alexey Borzenkov Date: Thu, 10 Feb 2022 16:47:43 +0300 Subject: Restoring authorship annotation for Alexey Borzenkov . Commit 2 of 2. --- library/cpp/threading/future/core/future-inl.h | 8 ++++---- library/cpp/threading/future/core/future.h | 22 +++++++++++----------- library/cpp/threading/future/future_ut.cpp | 8 ++++---- 3 files changed, 19 insertions(+), 19 deletions(-) (limited to 'library/cpp/threading/future') diff --git a/library/cpp/threading/future/core/future-inl.h b/library/cpp/threading/future/core/future-inl.h index 506c77d4c84..5fd4296a93c 100644 --- a/library/cpp/threading/future/core/future-inl.h +++ b/library/cpp/threading/future/core/future-inl.h @@ -619,8 +619,8 @@ namespace NThreading { template template - inline TFuture>> TFuture::Apply(F&& func) const { - auto promise = NewPromise>>(); + inline TFuture>> TFuture::Apply(F&& func) const { + auto promise = NewPromise>>(); Subscribe([promise, func = std::forward(func)](const TFuture& future) mutable { NImpl::SetValue(promise, [&]() { return func(future); }); }); @@ -718,8 +718,8 @@ namespace NThreading { template - inline TFuture>> TFuture::Apply(F&& func) const { - auto promise = NewPromise>>(); + inline TFuture>> TFuture::Apply(F&& func) const { + auto promise = NewPromise>>(); Subscribe([promise, func = std::forward(func)](const TFuture& future) mutable { NImpl::SetValue(promise, [&]() { return func(future); }); }); diff --git a/library/cpp/threading/future/core/future.h b/library/cpp/threading/future/core/future.h index 00dc245d9aa..2e82bb953eb 100644 --- a/library/cpp/threading/future/core/future.h +++ b/library/cpp/threading/future/core/future.h @@ -47,20 +47,20 @@ namespace NThreading { struct TFutureType> { using TType = typename TFutureType::TType; }; - - template - struct TFutureCallResult { - // NOTE: separate class for msvc compatibility - using TType = decltype(std::declval()(std::declval&>())); - }; + + template + struct TFutureCallResult { + // NOTE: separate class for msvc compatibility + using TType = decltype(std::declval()(std::declval&>())); + }; } template using TFutureType = typename NImpl::TFutureType::TType; - template - using TFutureCallResult = typename NImpl::TFutureCallResult::TType; - + template + using TFutureCallResult = typename NImpl::TFutureCallResult::TType; + //! Type of the future/promise state identifier class TFutureStateId; @@ -109,7 +109,7 @@ namespace NThreading { const TFuture& NoexceptSubscribe(F&& callback) const noexcept; template - TFuture>> Apply(F&& func) const; + TFuture>> Apply(F&& func) const; TFuture IgnoreResult() const; @@ -164,7 +164,7 @@ namespace NThreading { const TFuture& NoexceptSubscribe(F&& callback) const noexcept; template - TFuture>> Apply(F&& func) const; + TFuture>> Apply(F&& func) const; template TFuture Return(const R& value) const; diff --git a/library/cpp/threading/future/future_ut.cpp b/library/cpp/threading/future/future_ut.cpp index 377154e8670..05950a568d4 100644 --- a/library/cpp/threading/future/future_ut.cpp +++ b/library/cpp/threading/future/future_ut.cpp @@ -168,7 +168,7 @@ namespace { TTestCallback callback(123); TFuture future = promise.GetFuture() - .Apply([&](const auto& theFuture) { return callback.Func(theFuture); }); + .Apply([&](const auto& theFuture) { return callback.Func(theFuture); }); promise.SetValue(456); UNIT_ASSERT_EQUAL(future.GetValue(), 123 + 456); @@ -180,7 +180,7 @@ namespace { TTestCallback callback(123); TFuture future = promise.GetFuture() - .Apply([&](const auto& theFuture) { return callback.VoidFunc(theFuture); }); + .Apply([&](const auto& theFuture) { return callback.VoidFunc(theFuture); }); promise.SetValue(456); UNIT_ASSERT(future.HasValue()); @@ -191,7 +191,7 @@ namespace { TTestCallback callback(123); TFuture future = promise.GetFuture() - .Apply([&](const auto& theFuture) { return callback.FutureFunc(theFuture); }); + .Apply([&](const auto& theFuture) { return callback.FutureFunc(theFuture); }); promise.SetValue(456); UNIT_ASSERT_EQUAL(future.GetValue(), 123 + 456); @@ -203,7 +203,7 @@ namespace { TTestCallback callback(123); TFuture future = promise.GetFuture() - .Apply([&](const auto& theFuture) { return callback.FutureVoidFunc(theFuture); }); + .Apply([&](const auto& theFuture) { return callback.FutureVoidFunc(theFuture); }); promise.SetValue(456); UNIT_ASSERT(!future.HasValue()); -- cgit v1.3