A class that takes a function with a return value (but no arguments), and constructs a task with no return value along with a future used to retrieve the function's return value once the task is executed. Used by submit_task() and submit_bulk().
More...
#include <BS_thread_pool.hpp>
|
| template<typename F, typename = std::enable_if_t<!std::is_same_v<std::decay_t<F>, task_and_future<R>>>> |
| | task_and_future (F &&func) |
|
|
std::future< R > | future |
|
task_t | task |
template<typename R>
struct BS::task_and_future< R >
A class that takes a function with a return value (but no arguments), and constructs a task with no return value along with a future used to retrieve the function's return value once the task is executed. Used by submit_task() and submit_bulk().
- Template Parameters
-
| R | The return type of the function (can be void). |
◆ task_and_future()
template<typename R>
template<typename F, typename = std::enable_if_t<!std::is_same_v<std::decay_t<F>, task_and_future<R>>>>
732 {
736 {
737#ifdef __cpp_exceptions
738 try
739 {
740#endif
742 {
743 task();
745 }
746 else
747 {
749 }
750#ifdef __cpp_exceptions
751 }
752 catch (...)
753 {
754 try
755 {
757 }
758 catch (...)
759 {
760 }
761 }
762#endif
763 };
764 }
A class that takes a function with a return value (but no arguments), and constructs a task with no r...
Definition BS_thread_pool.hpp:729
The documentation for this struct was generated from the following file: