diff options
author | lexeyo <lexeyo@yandex-team.ru> | 2022-02-10 16:50:52 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:52 +0300 |
commit | c0a1bd5a47467ef8bf618172a331c90a2e70d71f (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/threading/future/core/future-inl.h | |
parent | 7bd28c29ae2a1fba7a03bcf4c658af66fe1373bf (diff) | |
download | ydb-c0a1bd5a47467ef8bf618172a331c90a2e70d71f.tar.gz |
Restoring authorship annotation for <lexeyo@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/threading/future/core/future-inl.h')
-rw-r--r-- | library/cpp/threading/future/core/future-inl.h | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/library/cpp/threading/future/core/future-inl.h b/library/cpp/threading/future/core/future-inl.h index 128d6d967b..5fd4296a93 100644 --- a/library/cpp/threading/future/core/future-inl.h +++ b/library/cpp/threading/future/core/future-inl.h @@ -506,32 +506,32 @@ namespace NThreading { //////////////////////////////////////////////////////////////////////////////// - class TFutureStateId { - private: - const void* Id; - - public: - template <typename T> - explicit TFutureStateId(const NImpl::TFutureState<T>& state) - : Id(&state) - { - } - - const void* Value() const noexcept { - return Id; - } - }; - - inline bool operator==(const TFutureStateId& l, const TFutureStateId& r) { - return l.Value() == r.Value(); - } - - inline bool operator!=(const TFutureStateId& l, const TFutureStateId& r) { - return !(l == r); - } - - //////////////////////////////////////////////////////////////////////////////// - + class TFutureStateId { + private: + const void* Id; + + public: + template <typename T> + explicit TFutureStateId(const NImpl::TFutureState<T>& state) + : Id(&state) + { + } + + const void* Value() const noexcept { + return Id; + } + }; + + inline bool operator==(const TFutureStateId& l, const TFutureStateId& r) { + return l.Value() == r.Value(); + } + + inline bool operator!=(const TFutureStateId& l, const TFutureStateId& r) { + return !(l == r); + } + + //////////////////////////////////////////////////////////////////////////////// + template <typename T> inline TFuture<T>::TFuture(const TIntrusivePtr<TFutureState>& state) noexcept : State(state) @@ -642,11 +642,11 @@ namespace NThreading { } template <typename T> - inline TMaybe<TFutureStateId> TFuture<T>::StateId() const noexcept { - return State != nullptr ? MakeMaybe<TFutureStateId>(*State) : Nothing(); - } - - template <typename T> + inline TMaybe<TFutureStateId> TFuture<T>::StateId() const noexcept { + return State != nullptr ? MakeMaybe<TFutureStateId>(*State) : Nothing(); + } + + template <typename T> inline void TFuture<T>::EnsureInitialized() const { if (!State) { ythrow TFutureException() << "state not initialized"; @@ -745,10 +745,10 @@ namespace NThreading { return bool(State); } - inline TMaybe<TFutureStateId> TFuture<void>::StateId() const noexcept { - return State != nullptr ? MakeMaybe<TFutureStateId>(*State) : Nothing(); - } - + inline TMaybe<TFutureStateId> TFuture<void>::StateId() const noexcept { + return State != nullptr ? MakeMaybe<TFutureStateId>(*State) : Nothing(); + } + inline void TFuture<void>::EnsureInitialized() const { if (!State) { ythrow TFutureException() << "state not initialized"; |