@@ -906,9 +906,7 @@ private:
906
906
907
907
// / \brief promise - allows a future value to be made available at a later time.
908
908
// /
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.
912
910
SEASTAR_MODULE_EXPORT
913
911
template <typename T>
914
912
class promise : private internal ::promise_base_with_type<T> {
@@ -1031,34 +1029,16 @@ concept Future = is_future<T>::value;
1031
1029
template <typename Func, typename ... T>
1032
1030
concept CanInvoke = std::invocable<Func, T...>;
1033
1031
1034
- // Deprecated alias
1035
- template <typename Func, typename ... T>
1036
- concept CanApply = CanInvoke<Func, T...>;
1037
-
1038
1032
template <typename Func, typename ... T>
1039
1033
concept CanApplyTuple
1040
1034
= sizeof ...(T) == 1
1041
1035
&& requires (Func func, std::tuple<T...> wrapped_val) {
1042
1036
{ std::apply (func, std::get<0 >(std::move (wrapped_val))) };
1043
1037
};
1044
1038
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
-
1055
1039
template <typename Func, typename ... T>
1056
1040
concept InvokeReturnsAnyFuture = Future<std::invoke_result_t <Func, T...>>;
1057
1041
1058
- // Deprecated alias
1059
- template <typename Func, typename ... T>
1060
- concept ApplyReturnsAnyFuture = InvokeReturnsAnyFuture<Func, T...>;
1061
-
1062
1042
// / \endcond
1063
1043
1064
1044
// 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 {
1208
1188
// / \ref semaphore), control their concurrency, their resource consumption
1209
1189
// / and handle any errors raised from them.
1210
1190
// /
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
1214
1193
// / contains a success/failure indication (and in the case of a
1215
1194
// / failure, an exception).
1216
- // / A list with two or more types is deprecated; use
1217
- // / \c future<std::tuple<T...>> instead.
1218
1195
SEASTAR_MODULE_EXPORT
1219
1196
template <typename T>
1220
1197
class [[nodiscard]] future : private internal::future_base {
@@ -1329,31 +1306,7 @@ public:
1329
1306
return get_available_state_ref ().get_exception ();
1330
1307
}
1331
1308
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().
1352
1309
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
- }
1357
1310
1358
1311
// / Wait for the future to be available (in a seastar::thread)
1359
1312
// /
@@ -1856,13 +1809,6 @@ struct futurize : public internal::futurize_base<T> {
1856
1809
return invoke (std::forward<Func>(func));
1857
1810
}
1858
1811
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
-
1866
1812
static type current_exception_as_future () noexcept {
1867
1813
return type (future_state_base::current_exception_future_marker ());
1868
1814
}
@@ -2043,12 +1989,6 @@ auto futurize_invoke(Func&& func, Args&&... args) noexcept {
2043
1989
return futurator::invoke (std::forward<Func>(func), std::forward<Args>(args)...);
2044
1990
}
2045
1991
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
-
2052
1992
template <typename Func, typename ... Args>
2053
1993
auto futurize_apply (Func&& func, std::tuple<Args...>&& args) noexcept {
2054
1994
using futurator = futurize<std::invoke_result_t <Func, Args&&...>>;
0 commit comments