Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add result_type member type to dpp::task #1164

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions include/dpp/coro/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@ class task : private detail::task::task_base<R> {
*/
friend class detail::task::task_base<R>;

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

/**
* @brief Function called by the standard library when the coroutine is resumed.
*
Expand Down Expand Up @@ -450,6 +455,11 @@ class task<void> : private detail::task::task_base<void> {
*/
friend class detail::task::task_base<void>;

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

/**
* @brief Function called by the standard library when the coroutine is resumed.
*
Expand Down
Loading