Make the tag type used by the await "keyword" part of the public interface.
diff --git a/asio/include/asio/coroutine.hpp b/asio/include/asio/coroutine.hpp index 005af2a..f1c4cba 100644 --- a/asio/include/asio/coroutine.hpp +++ b/asio/include/asio/coroutine.hpp
@@ -319,9 +319,11 @@ int value_; }; -namespace detail { +/// Used to as a return value to tag functions that will generate an @c await +/// result for a coroutine. +template <typename T> class awaitable {}; -template <typename T> class coroutine_async_result {}; +namespace detail { class coroutine_ref { @@ -357,14 +359,14 @@ // Operator used to associate a variable to store the async result. template <typename T> - coroutine_async_result<T> operator&(T& t) + awaitable<T> operator&(T& t) { *async_result_ = &t; - return coroutine_async_result<T>(); + return awaitable<T>(); } // This overload is used when the result is ignored. - template <typename T> void operator&(coroutine_async_result<T>) + template <typename T> void operator&(awaitable<T>) { }
diff --git a/asio/include/asio/impl/go.hpp b/asio/include/asio/impl/go.hpp index 1d6fa06..45ac9b9 100644 --- a/asio/include/asio/impl/go.hpp +++ b/asio/include/asio/impl/go.hpp
@@ -336,7 +336,7 @@ class async_result<detail::stackless_handler<Handler, T> > { public: - typedef detail::coroutine_async_result<T> type; + typedef awaitable<T> type; explicit async_result(detail::stackless_handler<Handler, T>&) {