mirror of
https://github.com/Naios/continuable.git
synced 2026-02-16 15:19:48 +08:00
Improve order dependence for the coroutine detection
This commit is contained in:
parent
c702682e40
commit
a3e995c0ce
@ -36,7 +36,6 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <continuable/detail/awaiting.hpp>
|
|
||||||
#include <continuable/detail/base.hpp>
|
#include <continuable/detail/base.hpp>
|
||||||
#include <continuable/detail/composition-all.hpp>
|
#include <continuable/detail/composition-all.hpp>
|
||||||
#include <continuable/detail/composition-any.hpp>
|
#include <continuable/detail/composition-any.hpp>
|
||||||
@ -45,6 +44,11 @@
|
|||||||
#include <continuable/detail/traits.hpp>
|
#include <continuable/detail/traits.hpp>
|
||||||
#include <continuable/detail/types.hpp>
|
#include <continuable/detail/types.hpp>
|
||||||
#include <continuable/detail/util.hpp>
|
#include <continuable/detail/util.hpp>
|
||||||
|
#include <continuable/detail/features.hpp>
|
||||||
|
|
||||||
|
#ifdef CONTINUABLE_HAS_EXPERIMENTAL_COROUTINE
|
||||||
|
#include <continuable/detail/awaiting.hpp>
|
||||||
|
#endif // CONTINUABLE_HAS_EXPERIMENTAL_COROUTINE
|
||||||
|
|
||||||
namespace cti {
|
namespace cti {
|
||||||
/// \defgroup Base Base
|
/// \defgroup Base Base
|
||||||
|
|||||||
@ -28,16 +28,13 @@
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
// Exclude this header when coroutines are not available
|
||||||
#ifndef CONTINUABLE_DETAIL_AWAITING_HPP_INCLUDED
|
#ifndef CONTINUABLE_DETAIL_AWAITING_HPP_INCLUDED
|
||||||
#define CONTINUABLE_DETAIL_AWAITING_HPP_INCLUDED
|
#define CONTINUABLE_DETAIL_AWAITING_HPP_INCLUDED
|
||||||
|
|
||||||
// Exlude this header when coroutines are not available
|
|
||||||
#ifdef CONTINUABLE_HAS_EXPERIMENTAL_COROUTINE
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <experimental/coroutine>
|
#include <experimental/coroutine>
|
||||||
|
|
||||||
#include <continuable/detail/base.hpp>
|
|
||||||
#include <continuable/detail/expected.hpp>
|
#include <continuable/detail/expected.hpp>
|
||||||
#include <continuable/detail/features.hpp>
|
#include <continuable/detail/features.hpp>
|
||||||
#include <continuable/detail/hints.hpp>
|
#include <continuable/detail/hints.hpp>
|
||||||
@ -133,32 +130,13 @@ template <typename Data, typename... Args, typename... FunctionArgs>
|
|||||||
struct coroutine_traits<
|
struct coroutine_traits<
|
||||||
cti::continuable_base<Data,
|
cti::continuable_base<Data,
|
||||||
cti::detail::hints::signature_hint_tag<Args...>>,
|
cti::detail::hints::signature_hint_tag<Args...>>,
|
||||||
FunctionArgs...> /*{
|
FunctionArgs...> {
|
||||||
struct promise_type {
|
|
||||||
// boost::promise<R> p;
|
static_assert(cti::detail::traits::fail<Data>::value,
|
||||||
auto get_return_object() {
|
"Using a continuable as return value from co_return "
|
||||||
// return p.get_future();
|
"expressions isn't supported yet!");
|
||||||
}
|
};
|
||||||
suspend_always initial_suspend() {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
suspend_never final_suspend() {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
void set_exception(std::exception_ptr e) {
|
|
||||||
// p.set_exception(std::move(e));
|
|
||||||
}
|
|
||||||
void unhandled_exception() {
|
|
||||||
// p.set_exception(std::current_exception());
|
|
||||||
}
|
|
||||||
template <typename U>
|
|
||||||
void return_value(U&& u) {
|
|
||||||
// p.set_value(std::forward<U>(u));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}*/;
|
|
||||||
} // namespace experimental
|
} // namespace experimental
|
||||||
} // namespace std
|
} // namespace std
|
||||||
|
|
||||||
#endif // CONTINUABLE_HAS_EXPERIMENTAL_COROUTINE
|
|
||||||
#endif // CONTINUABLE_DETAIL_UTIL_HPP_INCLUDED
|
#endif // CONTINUABLE_DETAIL_UTIL_HPP_INCLUDED
|
||||||
|
|||||||
@ -21,6 +21,9 @@
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
#include <test-continuable.hpp>
|
||||||
|
|
||||||
|
#include <continuable/detail/features.hpp>
|
||||||
#ifdef CONTINUABLE_HAS_EXPERIMENTAL_COROUTINE
|
#ifdef CONTINUABLE_HAS_EXPERIMENTAL_COROUTINE
|
||||||
|
|
||||||
#ifndef CONTINUABLE_WITH_NO_EXCEPTIONS
|
#ifndef CONTINUABLE_WITH_NO_EXCEPTIONS
|
||||||
@ -29,8 +32,6 @@
|
|||||||
|
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
#include <test-continuable.hpp>
|
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
namespace experimental {
|
namespace experimental {
|
||||||
template <class... T>
|
template <class... T>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user