Skip to content

Commit faa4bbc

Browse files
committed
future: remove deprecated functions/concepts
These were deprecated 4 years ago (except one, 1 year ago) and are mostly related to variadic futures.
1 parent 7ab2d7f commit faa4bbc

File tree

1 file changed

+3
-63
lines changed

1 file changed

+3
-63
lines changed

include/seastar/core/future.hh

+3-63
Original file line numberDiff line numberDiff line change
@@ -906,9 +906,7 @@ private:
906906

907907
/// \brief promise - allows a future value to be made available at a later time.
908908
///
909-
/// \tparam T A list of types to be carried as the result of the associated future.
910-
/// A list with two or more types is deprecated; use
911-
/// \c promise<std::tuple<T...>> instead.
909+
/// \tparam T A type to be carried as the result of the associated future. Use void (default) for no result.
912910
SEASTAR_MODULE_EXPORT
913911
template <typename T>
914912
class promise : private internal::promise_base_with_type<T> {
@@ -1031,34 +1029,16 @@ concept Future = is_future<T>::value;
10311029
template <typename Func, typename... T>
10321030
concept CanInvoke = std::invocable<Func, T...>;
10331031

1034-
// Deprecated alias
1035-
template <typename Func, typename... T>
1036-
concept CanApply = CanInvoke<Func, T...>;
1037-
10381032
template <typename Func, typename... T>
10391033
concept CanApplyTuple
10401034
= sizeof...(T) == 1
10411035
&& requires (Func func, std::tuple<T...> wrapped_val) {
10421036
{ std::apply(func, std::get<0>(std::move(wrapped_val))) };
10431037
};
10441038

1045-
// Deprecated, use std::is_invocable_r_v
1046-
template <typename Func, typename Return, typename... T>
1047-
concept InvokeReturns = requires (Func f, T... args) {
1048-
{ f(std::forward<T>(args)...) } -> std::same_as<Return>;
1049-
};
1050-
1051-
// Deprecated alias
1052-
template <typename Func, typename Return, typename... T>
1053-
concept ApplyReturns = InvokeReturns<Func, Return, T...>;
1054-
10551039
template <typename Func, typename... T>
10561040
concept InvokeReturnsAnyFuture = Future<std::invoke_result_t<Func, T...>>;
10571041

1058-
// Deprecated alias
1059-
template <typename Func, typename... T>
1060-
concept ApplyReturnsAnyFuture = InvokeReturnsAnyFuture<Func, T...>;
1061-
10621042
/// \endcond
10631043

10641044
// Converts a type to a future type, if it isn't already.
@@ -1208,13 +1188,10 @@ task* continuation_base_with_promise<Promise, T>::waiting_task() noexcept {
12081188
/// \ref semaphore), control their concurrency, their resource consumption
12091189
/// and handle any errors raised from them.
12101190
///
1211-
/// \tparam T A list of types to be carried as the result of the future,
1212-
/// similar to \c std::tuple<T...>. An empty list (\c future<>)
1213-
/// means that there is no result, and an available future only
1191+
/// \tparam T A type to be carried as the result of the future, or void
1192+
/// for no result. An available future<void> only
12141193
/// contains a success/failure indication (and in the case of a
12151194
/// failure, an exception).
1216-
/// A list with two or more types is deprecated; use
1217-
/// \c future<std::tuple<T...>> instead.
12181195
SEASTAR_MODULE_EXPORT
12191196
template <typename T>
12201197
class [[nodiscard]] future : private internal::future_base {
@@ -1329,31 +1306,7 @@ public:
13291306
return get_available_state_ref().get_exception();
13301307
}
13311308

1332-
/// Gets the value returned by the computation.
1333-
///
1334-
/// Similar to \ref get(), but instead of returning a
1335-
/// \c T&&, returns \c T.
1336-
///
1337-
/// \note The \c get0() method is deprecated. It's a remnant from older
1338-
/// versions of Seastar that supported variadic futures, capable of
1339-
/// returning multiple values through a tuple. Back then, \c get0() served
1340-
/// the purpose of retrieving the first (and usually the only) value.
1341-
/// Today, the \ref get() method accomplishes the same task. However,
1342-
/// there's a subtle difference in return types: \c get0() returned
1343-
/// \c T, while \ref get() returns \c T&& (an rvalue reference to
1344-
/// \c T). This distinction typically won't cause issues when switching
1345-
/// from \c get0() to \ref get(). However, in specific metaprogramming
1346-
/// scenarios, especially when the code expects type \c T, you'll need
1347-
/// to use \c std::remove_reference_t<decltype(fut.get())> to extract
1348-
/// the underlying type \c T.
1349-
/// For new code that utilizes \c future<tuple<...>>, employ
1350-
/// \c std::get<0>(fut.get()) to access the first element of the tuple,
1351-
/// rather than the deprecated \ref get0().
13521309
using get0_return_type = typename future_state::get0_return_type;
1353-
[[deprecated("Use get() instead")]]
1354-
get0_return_type get0() {
1355-
return (get0_return_type)get();
1356-
}
13571310

13581311
/// Wait for the future to be available (in a seastar::thread)
13591312
///
@@ -1856,13 +1809,6 @@ struct futurize : public internal::futurize_base<T> {
18561809
return invoke(std::forward<Func>(func));
18571810
}
18581811

1859-
/// Deprecated alias of invoke
1860-
template<typename Func, typename... FuncArgs>
1861-
[[deprecated("Use invoke for varargs")]]
1862-
static inline type apply(Func&& func, FuncArgs&&... args) noexcept {
1863-
return invoke(std::forward<Func>(func), std::forward<FuncArgs>(args)...);
1864-
}
1865-
18661812
static type current_exception_as_future() noexcept {
18671813
return type(future_state_base::current_exception_future_marker());
18681814
}
@@ -2043,12 +1989,6 @@ auto futurize_invoke(Func&& func, Args&&... args) noexcept {
20431989
return futurator::invoke(std::forward<Func>(func), std::forward<Args>(args)...);
20441990
}
20451991

2046-
template<typename Func, typename... Args>
2047-
[[deprecated("Use futurize_invoke for varargs")]]
2048-
auto futurize_apply(Func&& func, Args&&... args) noexcept {
2049-
return futurize_invoke(std::forward<Func>(func), std::forward<Args>(args)...);
2050-
}
2051-
20521992
template<typename Func, typename... Args>
20531993
auto futurize_apply(Func&& func, std::tuple<Args...>&& args) noexcept {
20541994
using futurator = futurize<std::invoke_result_t<Func, Args&&...>>;

0 commit comments

Comments
 (0)