aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpogorelov <pogorelov@yandex-team.com>2023-08-04 20:42:21 +0300
committerpogorelov <pogorelov@yandex-team.com>2023-08-04 21:38:43 +0300
commit0f496fc8a55e9d2dfd4fe9da109ef9abc58c68f4 (patch)
tree2650e63d306c436479781e1a0cc045a5586960e5
parentf7b3c32d20cd5ebcacd4e064fe6514d3ae0af267 (diff)
downloadydb-0f496fc8a55e9d2dfd4fe9da109ef9abc58c68f4.tar.gz
Define CFuture concept
-rw-r--r--yt/yt/core/actions/future.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/yt/yt/core/actions/future.h b/yt/yt/core/actions/future.h
index 9a7c4fcd8b..62fc4b9c1b 100644
--- a/yt/yt/core/actions/future.h
+++ b/yt/yt/core/actions/future.h
@@ -65,6 +65,12 @@ void Unref(TFutureState<T>* state);
template <class T>
[[nodiscard]] TFuture<T> MakeWellKnownFuture(TErrorOr<T> value);
+template<class T>
+constexpr bool IsFuture = false;
+
+template<class T>
+constexpr bool IsFuture<TFuture<T>> = true;
+
} // namespace NDetail
////////////////////////////////////////////////////////////////////////////////
@@ -710,6 +716,11 @@ TFuture<std::vector<TErrorOr<T>>> CancelableRunWithBoundedConcurrency(
////////////////////////////////////////////////////////////////////////////////
+template<class T>
+concept CFuture = NDetail::IsFuture<T>;
+
+////////////////////////////////////////////////////////////////////////////////
+
} // namespace NYT
////////////////////////////////////////////////////////////////////////////////