diff options
author | Alexey Borzenkov <snaury@yandex-team.ru> | 2022-02-10 16:47:43 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:43 +0300 |
commit | 330c83f8c116bd45316397b179275e9d87007e7d (patch) | |
tree | c0748b5dcbade83af788c0abfa89c0383d6b779c /library/cpp/threading/future/core | |
parent | 22d92781ba2a10b7fb5b977b7d1a5c40ff53885f (diff) | |
download | ydb-330c83f8c116bd45316397b179275e9d87007e7d.tar.gz |
Restoring authorship annotation for Alexey Borzenkov <snaury@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/threading/future/core')
-rw-r--r-- | library/cpp/threading/future/core/future-inl.h | 8 | ||||
-rw-r--r-- | library/cpp/threading/future/core/future.h | 22 |
2 files changed, 15 insertions, 15 deletions
diff --git a/library/cpp/threading/future/core/future-inl.h b/library/cpp/threading/future/core/future-inl.h index 506c77d4c8..5fd4296a93 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 <typename T> template <typename F> - inline TFuture<TFutureType<TFutureCallResult<F, T>>> TFuture<T>::Apply(F&& func) const { - auto promise = NewPromise<TFutureType<TFutureCallResult<F, T>>>(); + inline TFuture<TFutureType<TFutureCallResult<F, T>>> TFuture<T>::Apply(F&& func) const { + auto promise = NewPromise<TFutureType<TFutureCallResult<F, T>>>(); Subscribe([promise, func = std::forward<F>(func)](const TFuture<T>& future) mutable { NImpl::SetValue(promise, [&]() { return func(future); }); }); @@ -718,8 +718,8 @@ namespace NThreading { template <typename F> - inline TFuture<TFutureType<TFutureCallResult<F, void>>> TFuture<void>::Apply(F&& func) const { - auto promise = NewPromise<TFutureType<TFutureCallResult<F, void>>>(); + inline TFuture<TFutureType<TFutureCallResult<F, void>>> TFuture<void>::Apply(F&& func) const { + auto promise = NewPromise<TFutureType<TFutureCallResult<F, void>>>(); Subscribe([promise, func = std::forward<F>(func)](const TFuture<void>& 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 00dc245d9a..2e82bb953e 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<TFuture<T>> { using TType = typename TFutureType<T>::TType; }; - - template <typename F, typename T> - struct TFutureCallResult { - // NOTE: separate class for msvc compatibility - using TType = decltype(std::declval<F&>()(std::declval<const TFuture<T>&>())); - }; + + template <typename F, typename T> + struct TFutureCallResult { + // NOTE: separate class for msvc compatibility + using TType = decltype(std::declval<F&>()(std::declval<const TFuture<T>&>())); + }; } template <typename F> using TFutureType = typename NImpl::TFutureType<F>::TType; - template <typename F, typename T> - using TFutureCallResult = typename NImpl::TFutureCallResult<F, T>::TType; - + template <typename F, typename T> + using TFutureCallResult = typename NImpl::TFutureCallResult<F, T>::TType; + //! Type of the future/promise state identifier class TFutureStateId; @@ -109,7 +109,7 @@ namespace NThreading { const TFuture<T>& NoexceptSubscribe(F&& callback) const noexcept; template <typename F> - TFuture<TFutureType<TFutureCallResult<F, T>>> Apply(F&& func) const; + TFuture<TFutureType<TFutureCallResult<F, T>>> Apply(F&& func) const; TFuture<void> IgnoreResult() const; @@ -164,7 +164,7 @@ namespace NThreading { const TFuture<void>& NoexceptSubscribe(F&& callback) const noexcept; template <typename F> - TFuture<TFutureType<TFutureCallResult<F, void>>> Apply(F&& func) const; + TFuture<TFutureType<TFutureCallResult<F, void>>> Apply(F&& func) const; template <typename R> TFuture<R> Return(const R& value) const; |