Skip to content

Commit

Permalink
Merge branch 'dev' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
tarolling authored Jun 12, 2024
2 parents fcc6365 + dc0d347 commit 67eb0f1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/dpp/coro/async.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,11 @@ class async : private detail::async::async_base<R> {
using detail::async::async_base<R>::operator=; // use async_base's assignment operator
using detail::async::async_base<R>::await_ready; // expose await_ready as public

/**
* @brief The return type of the API call. Defaults to confirmation_callback_t
*/
using result_type = R;

/**
* @brief Construct an async object wrapping an object method, the call is made immediately by forwarding to <a href="https://en.cppreference.com/w/cpp/utility/functional/invoke">std::invoke</a> and can be awaited later to retrieve the result.
*
Expand Down
9 changes: 9 additions & 0 deletions include/dpp/coro/coroutine.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ class coroutine : private detail::coroutine::coroutine_base<R> {
}

public:
/**
* @brief The type of the result produced by this coroutine.
*/
using result_type = R;
#ifdef _DOXYGEN_ // :))))
/**
* @brief Default constructor, creates an empty coroutine.
Expand Down Expand Up @@ -334,6 +338,11 @@ class coroutine<void> : private detail::coroutine::coroutine_base<void> {
using detail::coroutine::coroutine_base<void>::operator=; // use coroutine_base's assignment operators
using detail::coroutine::coroutine_base<void>::await_ready; // expose await_ready as public

/**
* @brief The type of the result produced by this coroutine.
*/
using result_type = void;

/**
* @brief Suspend the current coroutine until the coroutine completes.
*
Expand Down
9 changes: 9 additions & 0 deletions include/dpp/coro/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ class task : private detail::task::task_base<R> {
}

public:
/**
* @brief The type of the result produced by this task.
*/
using result_type = R;
#ifdef _DOXYGEN_ // :)
/**
* @brief Default constructor, creates a task not bound to a coroutine.
Expand Down Expand Up @@ -465,6 +469,11 @@ class task<void> : private detail::task::task_base<void> {
using detail::task::task_base<void>::cancel; // expose cancel() as public
using detail::task::task_base<void>::await_ready; // expose await_ready as public

/**
* @brief The type of the result produced by this task
*/
using result_type = void;

/**
* @brief Suspend the current coroutine until the task completes.
*
Expand Down

0 comments on commit 67eb0f1

Please sign in to comment.