diff --git a/include/continuable/detail/support/asio.hpp b/include/continuable/detail/support/asio.hpp index f62fcee..d7c3fce 100644 --- a/include/continuable/detail/support/asio.hpp +++ b/include/continuable/detail/support/asio.hpp @@ -30,6 +30,8 @@ #ifndef CONTINUABLE_DETAIL_ASIO_HPP_INCLUDED #define CONTINUABLE_DETAIL_ASIO_HPP_INCLUDED +#include + #if defined(ASIO_STANDALONE) #include #include @@ -71,8 +73,7 @@ #endif #if defined(CTI_DETAIL_ASIO_HAS_NO_INTEGRATION) -#error \ - "First-class ASIO support for continuable requires the form of "\ +#error "First-class ASIO support for continuable requires the form of "\ "`async_result` with an `initiate` static member function, which was added " \ "in standalone ASIO 1.13.0 and Boost ASIO 1.70. Older versions can be " \ "integrated manually with `cti::promisify`." @@ -141,26 +142,15 @@ struct initiate_make_continuable; template struct initiate_make_continuable { - using is_void_cti_t = std::integral_constant; - #if defined(CTI_DETAIL_ASIO_HAS_EXPLICIT_RET_TYPE_INTEGRATION) - using erased_return_type = - std::conditional_t, - cti::continuable>; + using erased_return_type = cti::continuable; #endif - template - auto operator()(Continuation&& continuation, - std::enable_if_t* = 0) { - return cti::make_continuable( - std::forward(continuation)); - } - - template - auto operator()(Continuation&& continuation, - std::enable_if_t* = 0) { - return cti::make_continuable( - std::forward(continuation)); + template + auto operator()(Continuation&& continuation) { + return detail::base::attorney::create_from( + std::forward(continuation), detail::identity{}, + detail::util::ownership{}); } };