From: Avi Kivity <
a...@scylladb.com>
Committer: Nadav Har'El <
n...@scylladb.com>
Branch: master
future: make API level 6 mandatory
In e215023c78b0e ("future: Make futures non variadic"), we made futures
and related types non-variadic, and introduced API level 6 to ease
transition. 2½ years later we retire variadic futures completely and
make API level 6 mandatory.
Closes #1585
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -76,7 +76,7 @@ set (Seastar_API_LEVEL
set_property (CACHE Seastar_API_LEVEL
PROPERTY
- STRINGS 5 6)
+ STRINGS 6)
set (Seastar_SCHEDULING_GROUPS_COUNT
"16"
diff --git a/doc/compatibility.md b/doc/compatibility.md
--- a/doc/compatibility.md
+++ b/doc/compatibility.md
@@ -110,7 +110,7 @@ API Level History
| 3 | 2020-05 | 2023-03 | make_file_data_sink() closes file and returns a future<> |
| 4 | 2020-06 | 2023-03 | Non-variadic futures in when_all_succeed() |
| 5 | 2020-08 | 2023-03 | future::get() returns std::monostate() instead of void |
-| 6 | 2020-09 | | future<T> instead of future<T...> |
+| 6 | 2020-09 | 2023-03 | future<T> instead of future<T...> |
Note: The "mandatory" column indicates when backwards compatibility
diff --git a/include/seastar/core/future.hh b/include/seastar/core/future.hh
--- a/include/seastar/core/future.hh
+++ b/include/seastar/core/future.hh
@@ -142,14 +142,10 @@ struct nested_exception : public std::exception {
/// \addtogroup future-module
/// @{
-#if SEASTAR_API_LEVEL < 6
-template <class... T>
-#else
template <class T = void>
-#endif
class promise;
-template <class SEASTAR_ELLIPSIS T>
+template <class T>
class future;
template <typename... T>
@@ -224,11 +220,7 @@ extern template
future<> current_exception_as_future() noexcept;
namespace internal {
-#if SEASTAR_API_LEVEL < 6
-template <class... T>
-#else
template <class T = void>
-#endif
class promise_base_with_type;
class promise_base;
@@ -547,7 +539,7 @@ public:
friend struct future_state;
template <typename... U>
friend future<U...> current_exception_as_future() noexcept;
- template <typename SEASTAR_ELLIPSIS U>
+ template <typename U>
friend class future;
template <typename T>
friend struct futurize;
@@ -681,17 +673,13 @@ struct future_state : public future_state_base, private internal::uninitialized
}
};
-#if SEASTAR_API_LEVEL < 6
-template <typename... T>
-#else
template <typename T = void>
-#endif
class continuation_base : public task {
protected:
- using future_state = seastar::future_state<internal::future_stored_type_t<T SEASTAR_ELLIPSIS>>;
+ using future_state = seastar::future_state<internal::future_stored_type_t<T>>;
future_state _state;
- using future_type = future<T SEASTAR_ELLIPSIS>;
- using promise_type = promise<T SEASTAR_ELLIPSIS>;
+ using future_type = future<T>;
+ using promise_type = promise<T>;
public:
continuation_base() noexcept = default;
void set_state(future_state&& state) noexcept {
@@ -702,9 +690,9 @@ public:
// of derived classes are already destroyed at that time. If we didn't
// have this override we would get a "pure virtual function call" exception.
virtual task* waiting_task() noexcept override { return nullptr; }
- friend class internal::promise_base_with_type<T SEASTAR_ELLIPSIS>;
- friend class promise<T SEASTAR_ELLIPSIS>;
- friend class future<T SEASTAR_ELLIPSIS>;
+ friend class internal::promise_base_with_type<T>;
+ friend class promise<T>;
+ friend class future<T>;
};
// Given a future type, find the corresponding continuation_base.
@@ -719,13 +707,9 @@ struct continuation_base_from_future<future<T...>> {
template <typename Future>
using continuation_base_from_future_t = typename continuation_base_from_future<Future>::type;
-#if SEASTAR_API_LEVEL < 6
-template <typename Promise, typename... T>
-#else
template <typename Promise, typename T = void>
-#endif
-class continuation_base_with_promise : public continuation_base<T SEASTAR_ELLIPSIS> {
- friend class internal::promise_base_with_type<T SEASTAR_ELLIPSIS>;
+class continuation_base_with_promise : public continuation_base<T> {
+ friend class internal::promise_base_with_type<T>;
protected:
continuation_base_with_promise(Promise&& pr) noexcept : _pr(std::move(pr)) {
task::make_backtrace();
@@ -734,12 +718,8 @@ protected:
Promise _pr;
};
-#if SEASTAR_API_LEVEL < 6
-template <typename Promise, typename Func, typename Wrapper, typename... T>
-#else
template <typename Promise, typename Func, typename Wrapper, typename T = void>
-#endif
-struct continuation final : continuation_base_with_promise<Promise, T SEASTAR_ELLIPSIS> {
+struct continuation final : continuation_base_with_promise<Promise, T> {
// Func is the original function passed to then/then_wrapped. The
// Wrapper is a helper function that implements the specific logic
// needed by then/then_wrapped. We call the wrapper passing it the
@@ -751,7 +731,7 @@ struct continuation final : continuation_base_with_promise<Promise, T SEASTAR_EL
// std::unexpected as close to the failure as possible is the best
// we can do.
continuation(Promise&& pr, Func&& func, Wrapper&& wrapper) noexcept
- : continuation_base_with_promise<Promise, T SEASTAR_ELLIPSIS>(std::move(pr))
+ : continuation_base_with_promise<Promise, T>(std::move(pr))
, _func(std::move(func))
, _wrapper(std::move(wrapper)) {}
virtual void run_and_dispose() noexcept override {
@@ -843,7 +823,7 @@ protected:
}
friend class future_base;
- template <typename SEASTAR_ELLIPSIS U> friend class seastar::future;
+ template <typename U> friend class seastar::future;
public:
/// Set this promise to the current exception.
@@ -862,17 +842,17 @@ public:
/// future is created first, so we know the promise always has an
/// external place to point to. We cannot just use promise_base
/// because we need to know the type that is being stored.
-template <typename SEASTAR_ELLIPSIS T>
+template <typename T>
class promise_base_with_type : protected internal::promise_base {
protected:
- using future_state = seastar::future_state<future_stored_type_t<T SEASTAR_ELLIPSIS>>;
+ using future_state = seastar::future_state<future_stored_type_t<T>>;
future_state* get_state() noexcept {
return static_cast<future_state*>(_state);
}
static constexpr bool copy_noexcept = future_state::copy_noexcept;
public:
promise_base_with_type(future_state_base* state) noexcept : promise_base(state) { }
- promise_base_with_type(future<T SEASTAR_ELLIPSIS>* future) noexcept : promise_base(future, &future->_state) { }
+ promise_base_with_type(future<T>* future) noexcept : promise_base(future, &future->_state) { }
promise_base_with_type(promise_base_with_type&& x) noexcept = default;
promise_base_with_type(const promise_base_with_type&) = delete;
promise_base_with_type& operator=(promise_base_with_type&& x) noexcept = default;
@@ -913,7 +893,7 @@ public:
private:
- template <typename SEASTAR_ELLIPSIS U>
+ template <typename U>
friend class seastar::future;
friend future_state;
@@ -926,25 +906,25 @@ private:
/// \tparam T A list of types to be carried as the result of the associated future.
/// A list with two or more types is deprecated; use
/// \c promise<std::tuple<T...>> instead.
-template <typename SEASTAR_ELLIPSIS T>
-class promise : private internal::promise_base_with_type<T SEASTAR_ELLIPSIS> {
- using future_state = typename internal::promise_base_with_type<T SEASTAR_ELLIPSIS>::future_state;
+template <typename T>
+class promise : private internal::promise_base_with_type<T> {
+ using future_state = typename internal::promise_base_with_type<T>::future_state;
future_state _local_state;
public:
/// \brief Constructs an empty \c promise.
///
/// Creates promise with no associated future yet (see get_future()).
- promise() noexcept : internal::promise_base_with_type<T SEASTAR_ELLIPSIS>(&_local_state) {}
+ promise() noexcept : internal::promise_base_with_type<T>(&_local_state) {}
/// \brief Moves a \c promise object.
void move_it(promise&& x) noexcept;
- promise(promise&& x) noexcept : internal::promise_base_with_type<T SEASTAR_ELLIPSIS>(std::move(x)) {
+ promise(promise&& x) noexcept : internal::promise_base_with_type<T>(std::move(x)) {
move_it(std::move(x));
}
promise(const promise&) = delete;
promise& operator=(promise&& x) noexcept {
- internal::promise_base_with_type<T SEASTAR_ELLIPSIS>::operator=(std::move(x));
+ internal::promise_base_with_type<T>::operator=(std::move(x));
// If this is a self-move, _state is now nullptr and it is
// safe to call move_it.
move_it(std::move(x));
@@ -969,7 +949,7 @@ public:
/// both are moved. When \c set_value() or \c set_exception() are called
/// on the promise, the future will be become ready, and if a continuation
/// was attached to the future, it will run.
- future<T SEASTAR_ELLIPSIS> get_future() noexcept;
+ future<T> get_future() noexcept;
/// \brief Sets the promises value
///
@@ -984,7 +964,7 @@ public:
/// pr.set_value(std::tuple<int, double>(42, 43.0))
template <typename... A>
void set_value(A&&... a) noexcept {
- internal::promise_base_with_type<T SEASTAR_ELLIPSIS>::set_value(std::forward<A>(a)...);
+ internal::promise_base_with_type<T>::set_value(std::forward<A>(a)...);
}
/// \brief Marks the promise as failed
@@ -1008,22 +988,12 @@ public:
internal::promise_base::set_exception(std::forward<Exception>(e));
}
- using internal::promise_base_with_type<T SEASTAR_ELLIPSIS>::set_urgent_state;
+ using internal::promise_base_with_type<T>::set_urgent_state;
- template <typename SEASTAR_ELLIPSIS U>
+ template <typename U>
friend class future;
};
-#if SEASTAR_API_LEVEL < 6
-/// \brief Specialization of \c promise<void>
-///
-/// This is an alias for \c promise<>, for generic programming purposes.
-/// For example, You may have a \c promise<T> where \c T can legally be
-/// \c void.
-template<>
-class promise<void> : public promise<> {};
-#endif
-
/// @}
/// \addtogroup future-util
@@ -1171,8 +1141,8 @@ struct future_result<Func, void> {
using func_type = future_type ();
};
-template <typename Func, typename SEASTAR_ELLIPSIS T>
-using future_result_t = typename future_result<Func, T SEASTAR_ELLIPSIS>::type;
+template <typename Func, typename T>
+using future_result_t = typename future_result<Func, T>::type;
template <typename Func, typename T>
auto future_invoke(Func&& func, T&& v) {
@@ -1198,8 +1168,8 @@ using result_of_apply_t = typename result_of_apply<Func, T...>::type;
}
-template <typename Promise, typename SEASTAR_ELLIPSIS T>
-task* continuation_base_with_promise<Promise, T SEASTAR_ELLIPSIS>::waiting_task() noexcept {
+template <typename Promise, typename T>
+task* continuation_base_with_promise<Promise, T>::waiting_task() noexcept {
return _pr.waiting_task();
}
@@ -1245,9 +1215,9 @@ task* continuation_base_with_promise<Promise, T SEASTAR_ELLIPSIS>::waiting_task(
/// failure, an exception).
/// A list with two or more types is deprecated; use
/// \c future<std::tuple<T...>> instead.
-template <typename SEASTAR_ELLIPSIS T>
+template <typename T>
class [[nodiscard]] future : private internal::future_base {
- using future_state = seastar::future_state<internal::future_stored_type_t<T SEASTAR_ELLIPSIS>>;
+ using future_state = seastar::future_state<internal::future_stored_type_t<T>>;
future_state _state;
static constexpr bool copy_noexcept = future_state::copy_noexcept;
@@ -1260,7 +1230,7 @@ private:
// future_state.
future(future_for_get_promise_marker) noexcept { }
- future(promise<T SEASTAR_ELLIPSIS>* pr) noexcept : future_base(pr, &_state), _state(std::move(pr->_local_state)) { }
+ future(promise<T>* pr) noexcept : future_base(pr, &_state), _state(std::move(pr->_local_state)) { }
template <typename... A>
future(ready_future_marker m, A&&... a) noexcept : _state(m, std::forward<A>(a)...) { }
future(future_state_base::current_exception_future_marker m) noexcept : _state(m) {}
@@ -1272,14 +1242,14 @@ private:
explicit future(future_state&& state) noexcept
: _state(std::move(state)) {
}
- internal::promise_base_with_type<T SEASTAR_ELLIPSIS> get_promise() noexcept {
+ internal::promise_base_with_type<T> get_promise() noexcept {
assert(!_promise);
- return internal::promise_base_with_type<T SEASTAR_ELLIPSIS>(this);
+ return internal::promise_base_with_type<T>(this);
}
- internal::promise_base_with_type<T SEASTAR_ELLIPSIS>* detach_promise() noexcept {
- return static_cast<internal::promise_base_with_type<T SEASTAR_ELLIPSIS>*>(future_base::detach_promise());
+ internal::promise_base_with_type<T>* detach_promise() noexcept {
+ return static_cast<internal::promise_base_with_type<T>*>(future_base::detach_promise());
}
- void schedule(continuation_base<T SEASTAR_ELLIPSIS>* tws) noexcept {
+ void schedule(continuation_base<T>* tws) noexcept {
future_base::schedule(tws, &tws->_state);
}
template <typename Pr, typename Func, typename Wrapper>
@@ -1289,7 +1259,7 @@ private:
// and we cannot break the chain. Since this function is
// noexcept, it will call std::terminate if new throws.
memory::scoped_critical_alloc_section _;
- auto tws = new continuation<Pr, Func, Wrapper, T SEASTAR_ELLIPSIS>(std::move(pr), std::move(func), std::move(wrapper));
+ auto tws = new continuation<Pr, Func, Wrapper, T>(std::move(pr), std::move(func), std::move(wrapper));
// In a debug build we schedule ready futures, but not in
// other build modes.
#ifdef SEASTAR_DEBUG
@@ -1311,22 +1281,22 @@ private:
return std::move(_state);
}
- future<T SEASTAR_ELLIPSIS> rethrow_with_nested(future_state_base&& n) noexcept {
- return future<T SEASTAR_ELLIPSIS>(future_state_base::nested_exception_marker(), std::move(n), std::move(_state));
+ future<T> rethrow_with_nested(future_state_base&& n) noexcept {
+ return future<T>(future_state_base::nested_exception_marker(), std::move(n), std::move(_state));
}
- future<T SEASTAR_ELLIPSIS> rethrow_with_nested() noexcept {
- return future<T SEASTAR_ELLIPSIS>(future_state_base::nested_exception_marker(), std::move(_state));
+ future<T> rethrow_with_nested() noexcept {
+ return future<T>(future_state_base::nested_exception_marker(), std::move(_state));
}
template<typename... U>
friend class shared_future;
public:
/// \brief The data type carried by the future.
- using value_type = internal::future_stored_type_t<T SEASTAR_ELLIPSIS>;
+ using value_type = internal::future_stored_type_t<T>;
using tuple_type = internal::future_tuple_type_t<value_type>;
/// \brief The data type carried by the future.
- using promise_type = promise<T SEASTAR_ELLIPSIS>;
+ using promise_type = promise<T>;
/// \brief Moves the future into a new object.
[[gnu::always_inline]]
future(future&& x) noexcept : future_base(std::move(x), &_state), _state(std::move(x._state)) { }
@@ -1414,15 +1384,15 @@ public:
/// unless it has failed.
/// \return a \c future representing the return value of \c func, applied
/// to the eventual value of this future.
- template <typename Func, typename Result = typename internal::future_result<Func, T SEASTAR_ELLIPSIS>::future_type>
- SEASTAR_CONCEPT( requires std::invocable<Func, T SEASTAR_ELLIPSIS>
- || (std::same_as<std::tuple<void>, std::tuple<T SEASTAR_ELLIPSIS>> && std::invocable<Func>) )
+ template <typename Func, typename Result = typename internal::future_result<Func, T>::future_type>
+ SEASTAR_CONCEPT( requires std::invocable<Func, T>
+ || (std::same_as<std::tuple<void>, std::tuple<T>> && std::invocable<Func>) )
Result
then(Func&& func) noexcept {
#ifndef SEASTAR_TYPE_ERASE_MORE
return then_impl(std::move(func));
#else
- using func_type = typename internal::future_result<Func, T SEASTAR_ELLIPSIS>::func_type;
+ using func_type = typename internal::future_result<Func, T>::func_type;
noncopyable_function<func_type> ncf;
{
memory::scoped_critical_alloc_section _;
@@ -1453,13 +1423,13 @@ public:
/// unless it has failed.
/// \return a \c future representing the return value of \c func, applied
/// to the eventual value of this future.
- template <typename Func, typename Result = futurize_t<internal::result_of_apply_t<Func, T SEASTAR_ELLIPSIS>>>
- SEASTAR_CONCEPT( requires ::seastar::CanApplyTuple<Func, T SEASTAR_ELLIPSIS>)
+ template <typename Func, typename Result = futurize_t<internal::result_of_apply_t<Func, T>>>
+ SEASTAR_CONCEPT( requires ::seastar::CanApplyTuple<Func, T>)
Result
then_unpack(Func&& func) noexcept {
- return then([func = std::forward<Func>(func)] (T&& SEASTAR_ELLIPSIS tuple) mutable {
+ return then([func = std::forward<Func>(func)] (T&& tuple) mutable {
// sizeof...(tuple) is required to be 1
- return std::apply(func, std::move(tuple) SEASTAR_ELLIPSIS);
+ return std::apply(func, std::move(tuple));
});
}
@@ -1468,7 +1438,7 @@ private:
// Keep this simple so that Named Return Value Optimization is used.
template <typename Func, typename Result>
Result then_impl_nrvo(Func&& func) noexcept {
- using futurator = futurize<internal::future_result_t<Func, T SEASTAR_ELLIPSIS>>;
+ using futurator = futurize<internal::future_result_t<Func, T>>;
typename futurator::type fut(future_for_get_promise_marker{});
using pr_type = decltype(fut.get_promise());
schedule(fut.get_promise(), std::move(func), [](pr_type&& pr, Func& func, future_state&& state) {
@@ -1486,11 +1456,11 @@ private:
return fut;
}
- template <typename Func, typename Result = futurize_t<internal::future_result_t<Func, T SEASTAR_ELLIPSIS>>>
+ template <typename Func, typename Result = futurize_t<internal::future_result_t<Func, T>>>
Result
then_impl(Func&& func) noexcept {
#ifndef SEASTAR_DEBUG
- using futurator = futurize<internal::future_result_t<Func, T SEASTAR_ELLIPSIS>>;
+ using futurator = futurize<internal::future_result_t<Func, T>>;
if (failed()) {
return futurator::make_exception_future(static_cast<future_state_base&&>(get_available_state_ref()));
} else if (available()) {
@@ -1586,7 +1556,7 @@ private:
return then_wrapped_nrvo<FuncResult, Func>(std::forward<Func>(func));
}
- void forward_to(internal::promise_base_with_type<T SEASTAR_ELLIPSIS>&& pr) noexcept {
+ void forward_to(internal::promise_base_with_type<T>&& pr) noexcept {
if (_state.available()) {
pr.set_urgent_state(std::move(_state));
} else {
@@ -1605,7 +1575,7 @@ public:
///
/// \param pr a promise that will be fulfilled with the results of this
/// future.
- void forward_to(promise<T SEASTAR_ELLIPSIS>&& pr) noexcept {
+ void forward_to(promise<T>&& pr) noexcept {
if (_state.available()) {
pr.set_urgent_state(std::move(_state));
} else if (&pr._local_state != pr._state) {
@@ -1636,7 +1606,7 @@ public:
*/
template <typename Func>
SEASTAR_CONCEPT( requires std::invocable<Func> )
- future<T SEASTAR_ELLIPSIS> finally(Func&& func) noexcept {
+ future<T> finally(Func&& func) noexcept {
return then_wrapped(finally_body<Func, is_future<std::invoke_result_t<Func>>::value>(std::forward<Func>(func)));
}
@@ -1651,7 +1621,7 @@ public:
finally_body(Func&& func) noexcept : _func(std::forward<Func>(func))
{ }
- future<T SEASTAR_ELLIPSIS> operator()(future<T SEASTAR_ELLIPSIS>&& result) noexcept {
+ future<T> operator()(future<T>&& result) noexcept {
return futurize_invoke(_func).then_wrapped([result = std::move(result)](auto&& f_res) mutable {
if (!f_res.failed()) {
return std::move(result);
@@ -1669,7 +1639,7 @@ public:
finally_body(Func&& func) noexcept : _func(std::forward<Func>(func))
{ }
- future<T SEASTAR_ELLIPSIS> operator()(future<T SEASTAR_ELLIPSIS>&& result) noexcept {
+ future<T> operator()(future<T>&& result) noexcept {
try {
_func();
return std::move(result);
@@ -1717,16 +1687,16 @@ public:
/// successful value; Because handle_exception() is used here on a
/// future<>, the handler function does not need to return anything.
template <typename Func>
- SEASTAR_CONCEPT( requires ::seastar::InvokeReturns<Func, future<T SEASTAR_ELLIPSIS>, std::exception_ptr>
+ SEASTAR_CONCEPT( requires ::seastar::InvokeReturns<Func, future<T>, std::exception_ptr>
|| (std::tuple_size_v<tuple_type> == 0 && ::seastar::InvokeReturns<Func, void, std::exception_ptr>)
|| (std::tuple_size_v<tuple_type> == 1 && ::seastar::InvokeReturns<Func, T, std::exception_ptr>)
|| (std::tuple_size_v<tuple_type> > 1 && ::seastar::InvokeReturns<Func, tuple_type, std::exception_ptr>)
)
- future<T SEASTAR_ELLIPSIS> handle_exception(Func&& func) noexcept {
+ future<T> handle_exception(Func&& func) noexcept {
return then_wrapped([func = std::forward<Func>(func)]
- (auto&& fut) mutable -> future<T SEASTAR_ELLIPSIS> {
+ (auto&& fut) mutable -> future<T> {
if (!fut.failed()) {
- return make_ready_future<T SEASTAR_ELLIPSIS>(fut.get());
+ return make_ready_future<T>(fut.get());
} else {
return futurize_invoke(func, fut.get_exception());
}
@@ -1744,14 +1714,14 @@ public:
/// If exception, that future holds, does not match func parameter type
/// it is propagated as is.
template <typename Func>
- future<T SEASTAR_ELLIPSIS> handle_exception_type(Func&& func) noexcept {
+ future<T> handle_exception_type(Func&& func) noexcept {
using trait = function_traits<Func>;
static_assert(trait::arity == 1, "func can take only one parameter");
using ex_type = typename trait::template arg<0>::type;
return then_wrapped([func = std::forward<Func>(func)]
- (auto&& fut) mutable -> future<T SEASTAR_ELLIPSIS> {
+ (auto&& fut) mutable -> future<T> {
try {
- return make_ready_future<T SEASTAR_ELLIPSIS>(fut.get());
+ return make_ready_future<T>(fut.get());
} catch(ex_type& ex) {
return futurize_invoke(func, ex);
}
@@ -1771,7 +1741,7 @@ public:
using future_base::set_coroutine;
#endif
private:
- void set_callback(continuation_base<T SEASTAR_ELLIPSIS>* callback) noexcept {
+ void set_callback(continuation_base<T>* callback) noexcept {
if (_state.available()) {
callback->set_state(get_available_state_ref());
::seastar::schedule(callback);
@@ -1783,13 +1753,13 @@ private:
}
/// \cond internal
- template <typename SEASTAR_ELLIPSIS U>
+ template <typename U>
friend class future;
- template <typename SEASTAR_ELLIPSIS U>
+ template <typename U>
friend class promise;
template <typename U>
friend struct futurize;
- template <typename SEASTAR_ELLIPSIS U>
+ template <typename U>
friend class internal::promise_base_with_type;
template <typename... U, typename... A>
friend future<U...> make_ready_future(A&&... value) noexcept;
@@ -1908,7 +1878,7 @@ private:
SEASTAR_CONCEPT( requires std::invocable<Func> )
static void satisfy_with_result_of(promise_base_with_type&&, Func&& func);
- template <typename SEASTAR_ELLIPSIS U>
+ template <typename U>
friend class future;
};
@@ -1917,17 +1887,17 @@ inline internal::promise_base::promise_base(future_base* future, future_state_ba
_future->_promise = this;
}
-template <typename SEASTAR_ELLIPSIS T>
+template <typename T>
inline
-future<T SEASTAR_ELLIPSIS>
-promise<T SEASTAR_ELLIPSIS>::get_future() noexcept {
+future<T>
+promise<T>::get_future() noexcept {
assert(!this->_future && this->_state && !this->_task);
- return future<T SEASTAR_ELLIPSIS>(this);
+ return future<T>(this);
}
-template <typename SEASTAR_ELLIPSIS T>
+template <typename T>
inline
-void promise<T SEASTAR_ELLIPSIS>::move_it(promise&& x) noexcept {
+void promise<T>::move_it(promise&& x) noexcept {
if (this->_state == &x._local_state) {
this->_state = &_local_state;
new (&_local_state) future_state(std::move(x._local_state));
diff --git a/include/seastar/core/internal/api-level.hh b/include/seastar/core/internal/api-level.hh
--- a/include/seastar/core/internal/api-level.hh
+++ b/include/seastar/core/internal/api-level.hh
@@ -32,21 +32,11 @@
#define SEASTAR_INCLUDE_API_V6
#endif
-#if SEASTAR_API_LEVEL == 5
-#define SEASTAR_INCLUDE_API_V5 inline
-#else
-#define SEASTAR_INCLUDE_API_V5
-#endif
// Declare them here so we don't have to use the macros everywhere
namespace seastar {
- SEASTAR_INCLUDE_API_V5 namespace api_v5 {
- inline namespace and_newer {
- }
- }
SEASTAR_INCLUDE_API_V6 namespace api_v6 {
inline namespace and_newer {
- using namespace api_v5::and_newer;
}
}
}
diff --git a/include/seastar/core/scheduling.hh b/include/seastar/core/scheduling.hh
--- a/include/seastar/core/scheduling.hh
+++ b/include/seastar/core/scheduling.hh
@@ -34,13 +34,7 @@ namespace seastar {
constexpr unsigned max_scheduling_groups() { return SEASTAR_SCHEDULING_GROUPS_COUNT; }
-#if SEASTAR_API_LEVEL < 6
-#define SEASTAR_ELLIPSIS ...
-template <typename SEASTAR_ELLIPSIS T>
-#else
-#define SEASTAR_ELLIPSIS
template <typename T = void>
-#endif
class future;
class reactor;
diff --git a/include/seastar/rpc/rpc_impl.hh b/include/seastar/rpc/rpc_impl.hh
--- a/include/seastar/rpc/rpc_impl.hh
+++ b/include/seastar/rpc/rpc_impl.hh
@@ -499,21 +499,17 @@ auto send_helper(MsgType xt, signature<Ret (InArgs...)> xsig) {
return shelper{xt, xsig};
}
-template<typename Serializer, typename SEASTAR_ELLIPSIS RetTypes>
-inline future<> reply(wait_type, future<RetTypes SEASTAR_ELLIPSIS>&& ret, int64_t msg_id, shared_ptr<server::connection> client,
+template<typename Serializer, typename RetTypes>
+inline future<> reply(wait_type, future<RetTypes>&& ret, int64_t msg_id, shared_ptr<server::connection> client,
std::optional<rpc_clock_type::time_point> timeout) {
if (!client->error()) {
snd_buf data;
try {
-#if SEASTAR_API_LEVEL < 6
- if constexpr (sizeof...(RetTypes) == 0) {
-#else
if constexpr (std::is_void_v<RetTypes>) {
-#endif
ret.get();
data = std::invoke(marshall<Serializer>, std::ref(client->template serializer<Serializer>()), 12);
} else {
- data = std::invoke(marshall<Serializer, const RetTypes& SEASTAR_ELLIPSIS>, std::ref(client->template serializer<Serializer>()), 12, std::move(ret.get0()));
+ data = std::invoke(marshall<Serializer, const RetTypes&>, std::ref(client->template serializer<Serializer>()), 12, std::move(ret.get0()));
}
} catch (std::exception& ex) {
uint32_t len = std::strlen(ex.what());