mirror of
https://github.com/Naios/continuable.git
synced 2025-12-08 01:36:46 +08:00
Remove some using expressions
* Those caused issues in namespaces where symbols were preloaded * Formatting fixes
This commit is contained in:
parent
6b4f6de10f
commit
41f3429c85
@ -866,12 +866,11 @@ constexpr auto make_continuable(Continuation&& continuation) {
|
||||
/// \since 3.0.0
|
||||
template <typename... Args>
|
||||
auto make_ready_continuable(Args&&... args) {
|
||||
using detail::identity;
|
||||
using detail::base::ready_continuation;
|
||||
using detail::traits::unrefcv_t;
|
||||
return detail::base::attorney::create_from_raw(
|
||||
ready_continuation<unrefcv_t<Args>...>{std::forward<Args>(args)...},
|
||||
identity<unrefcv_t<Args>...>{}, detail::util::ownership{});
|
||||
detail::base::ready_continuation<detail::traits::unrefcv_t<Args>...>{
|
||||
std::forward<Args>(args)...},
|
||||
detail::identity<detail::traits::unrefcv_t<Args>...>{},
|
||||
detail::util::ownership{});
|
||||
}
|
||||
|
||||
/// Returns a continuable_base with the parameterized result which instantly
|
||||
|
||||
@ -80,8 +80,7 @@ class continuable_box<continuable_base<Data, identity<>>> {
|
||||
continuable_base<Data, identity<>> continuable_;
|
||||
|
||||
public:
|
||||
explicit continuable_box(
|
||||
continuable_base<Data, identity<>>&& continuable)
|
||||
explicit continuable_box(continuable_base<Data, identity<>>&& continuable)
|
||||
: continuable_(std::move(continuable)) {
|
||||
}
|
||||
|
||||
@ -137,8 +136,7 @@ class continuable_box<
|
||||
|
||||
public:
|
||||
explicit continuable_box(
|
||||
continuable_base<Data, identity<First, Second, Rest...>>&&
|
||||
continuable)
|
||||
continuable_base<Data, identity<First, Second, Rest...>>&& continuable)
|
||||
: continuable_(std::move(continuable)) {
|
||||
}
|
||||
|
||||
@ -209,13 +207,12 @@ constexpr auto unbox_continuables(Args&&... args) {
|
||||
|
||||
namespace detail {
|
||||
template <typename Callback, typename Data>
|
||||
constexpr auto finalize_impl(identity<void>, Callback&& callback,
|
||||
Data&&) {
|
||||
constexpr auto finalize_impl(identity<void>, Callback&& callback, Data&&) {
|
||||
return std::forward<Callback>(callback)();
|
||||
}
|
||||
template <typename... Args, typename Callback, typename Data>
|
||||
constexpr auto finalize_impl(identity<std::tuple<Args...>>,
|
||||
Callback&& callback, Data&& data) {
|
||||
constexpr auto finalize_impl(identity<std::tuple<Args...>>, Callback&& callback,
|
||||
Data&& data) {
|
||||
// Call the final callback with the cleaned result
|
||||
return traits::unpack(std::forward<Callback>(callback),
|
||||
unbox_continuables(std::forward<Data>(data)));
|
||||
|
||||
@ -130,8 +130,7 @@ struct result_deducer {
|
||||
return deduce_same_hints(deduce(
|
||||
traversal::container_category_of_t<
|
||||
std::decay_t<decltype(std::get<I>(std::declval<T>()))>>{},
|
||||
identity<
|
||||
std::decay_t<decltype(std::get<I>(std::declval<T>()))>>{})...);
|
||||
identity<std::decay_t<decltype(std::get<I>(std::declval<T>()))>>{})...);
|
||||
}
|
||||
|
||||
/// Traverse tuple like container
|
||||
|
||||
@ -179,15 +179,14 @@ template <typename... Expected>
|
||||
struct assert_async_types_validator {
|
||||
template <typename... Actual>
|
||||
void operator()(Actual...) {
|
||||
static_assert(std::is_same<identity<Actual...>,
|
||||
identity<Expected...>>::value,
|
||||
"The called arguments don't match with the expected ones!");
|
||||
static_assert(
|
||||
std::is_same<identity<Actual...>, identity<Expected...>>::value,
|
||||
"The called arguments don't match with the expected ones!");
|
||||
}
|
||||
};
|
||||
|
||||
template <typename C, typename... Args>
|
||||
void assert_async_types(C&& continuable,
|
||||
identity<Args...> /*expected*/) {
|
||||
void assert_async_types(C&& continuable, identity<Args...> /*expected*/) {
|
||||
assert_async_validation(std::forward<C>(continuable),
|
||||
assert_async_types_validator<Args...>{});
|
||||
}
|
||||
|
||||
@ -33,8 +33,8 @@
|
||||
|
||||
#include <future>
|
||||
#include <continuable/continuable-primitives.hpp>
|
||||
#include <continuable/detail/core/base.hpp>
|
||||
#include <continuable/detail/core/annotation.hpp>
|
||||
#include <continuable/detail/core/base.hpp>
|
||||
#include <continuable/detail/core/types.hpp>
|
||||
#include <continuable/detail/features.hpp>
|
||||
#include <continuable/detail/utility/util.hpp>
|
||||
@ -77,8 +77,7 @@ template <typename Hint>
|
||||
class promise_callback;
|
||||
|
||||
template <typename... Args>
|
||||
class promise_callback<identity<Args...>>
|
||||
: public future_trait<Args...> {
|
||||
class promise_callback<identity<Args...>> : public future_trait<Args...> {
|
||||
|
||||
typename future_trait<Args...>::promise_t promise_;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user