mirror of
https://github.com/Naios/continuable.git
synced 2026-02-11 12:49:49 +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
|
/// \since 3.0.0
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
auto make_ready_continuable(Args&&... 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(
|
return detail::base::attorney::create_from_raw(
|
||||||
ready_continuation<unrefcv_t<Args>...>{std::forward<Args>(args)...},
|
detail::base::ready_continuation<detail::traits::unrefcv_t<Args>...>{
|
||||||
identity<unrefcv_t<Args>...>{}, detail::util::ownership{});
|
std::forward<Args>(args)...},
|
||||||
|
detail::identity<detail::traits::unrefcv_t<Args>...>{},
|
||||||
|
detail::util::ownership{});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a continuable_base with the parameterized result which instantly
|
/// 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_;
|
continuable_base<Data, identity<>> continuable_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit continuable_box(
|
explicit continuable_box(continuable_base<Data, identity<>>&& continuable)
|
||||||
continuable_base<Data, identity<>>&& continuable)
|
|
||||||
: continuable_(std::move(continuable)) {
|
: continuable_(std::move(continuable)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,8 +136,7 @@ class continuable_box<
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit continuable_box(
|
explicit continuable_box(
|
||||||
continuable_base<Data, identity<First, Second, Rest...>>&&
|
continuable_base<Data, identity<First, Second, Rest...>>&& continuable)
|
||||||
continuable)
|
|
||||||
: continuable_(std::move(continuable)) {
|
: continuable_(std::move(continuable)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,13 +207,12 @@ constexpr auto unbox_continuables(Args&&... args) {
|
|||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template <typename Callback, typename Data>
|
template <typename Callback, typename Data>
|
||||||
constexpr auto finalize_impl(identity<void>, Callback&& callback,
|
constexpr auto finalize_impl(identity<void>, Callback&& callback, Data&&) {
|
||||||
Data&&) {
|
|
||||||
return std::forward<Callback>(callback)();
|
return std::forward<Callback>(callback)();
|
||||||
}
|
}
|
||||||
template <typename... Args, typename Callback, typename Data>
|
template <typename... Args, typename Callback, typename Data>
|
||||||
constexpr auto finalize_impl(identity<std::tuple<Args...>>,
|
constexpr auto finalize_impl(identity<std::tuple<Args...>>, Callback&& callback,
|
||||||
Callback&& callback, Data&& data) {
|
Data&& data) {
|
||||||
// Call the final callback with the cleaned result
|
// Call the final callback with the cleaned result
|
||||||
return traits::unpack(std::forward<Callback>(callback),
|
return traits::unpack(std::forward<Callback>(callback),
|
||||||
unbox_continuables(std::forward<Data>(data)));
|
unbox_continuables(std::forward<Data>(data)));
|
||||||
|
|||||||
@ -130,8 +130,7 @@ struct result_deducer {
|
|||||||
return deduce_same_hints(deduce(
|
return deduce_same_hints(deduce(
|
||||||
traversal::container_category_of_t<
|
traversal::container_category_of_t<
|
||||||
std::decay_t<decltype(std::get<I>(std::declval<T>()))>>{},
|
std::decay_t<decltype(std::get<I>(std::declval<T>()))>>{},
|
||||||
identity<
|
identity<std::decay_t<decltype(std::get<I>(std::declval<T>()))>>{})...);
|
||||||
std::decay_t<decltype(std::get<I>(std::declval<T>()))>>{})...);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Traverse tuple like container
|
/// Traverse tuple like container
|
||||||
|
|||||||
@ -179,15 +179,14 @@ template <typename... Expected>
|
|||||||
struct assert_async_types_validator {
|
struct assert_async_types_validator {
|
||||||
template <typename... Actual>
|
template <typename... Actual>
|
||||||
void operator()(Actual...) {
|
void operator()(Actual...) {
|
||||||
static_assert(std::is_same<identity<Actual...>,
|
static_assert(
|
||||||
identity<Expected...>>::value,
|
std::is_same<identity<Actual...>, identity<Expected...>>::value,
|
||||||
"The called arguments don't match with the expected ones!");
|
"The called arguments don't match with the expected ones!");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename C, typename... Args>
|
template <typename C, typename... Args>
|
||||||
void assert_async_types(C&& continuable,
|
void assert_async_types(C&& continuable, identity<Args...> /*expected*/) {
|
||||||
identity<Args...> /*expected*/) {
|
|
||||||
assert_async_validation(std::forward<C>(continuable),
|
assert_async_validation(std::forward<C>(continuable),
|
||||||
assert_async_types_validator<Args...>{});
|
assert_async_types_validator<Args...>{});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,8 +33,8 @@
|
|||||||
|
|
||||||
#include <future>
|
#include <future>
|
||||||
#include <continuable/continuable-primitives.hpp>
|
#include <continuable/continuable-primitives.hpp>
|
||||||
#include <continuable/detail/core/base.hpp>
|
|
||||||
#include <continuable/detail/core/annotation.hpp>
|
#include <continuable/detail/core/annotation.hpp>
|
||||||
|
#include <continuable/detail/core/base.hpp>
|
||||||
#include <continuable/detail/core/types.hpp>
|
#include <continuable/detail/core/types.hpp>
|
||||||
#include <continuable/detail/features.hpp>
|
#include <continuable/detail/features.hpp>
|
||||||
#include <continuable/detail/utility/util.hpp>
|
#include <continuable/detail/utility/util.hpp>
|
||||||
@ -77,8 +77,7 @@ template <typename Hint>
|
|||||||
class promise_callback;
|
class promise_callback;
|
||||||
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
class promise_callback<identity<Args...>>
|
class promise_callback<identity<Args...>> : public future_trait<Args...> {
|
||||||
: public future_trait<Args...> {
|
|
||||||
|
|
||||||
typename future_trait<Args...>::promise_t promise_;
|
typename future_trait<Args...>::promise_t promise_;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user