A helper struct to store a task with an assigned priority.
More...
#include <BS_thread_pool.hpp>
|
| | pr_task (task_t &&task_, const priority_t priority_=0) noexcept(std::is_nothrow_move_constructible_v< task_t >) |
| | Construct a new task with an assigned priority.
|
| |
|
|
task_t | task |
| | The task. It is mutable so it can be moved out of the const reference returned by std::priority_queue::top().
|
| |
|
priority_t | priority = 0 |
| | The priority of the task.
|
| |
A helper struct to store a task with an assigned priority.
◆ pr_task()
Construct a new task with an assigned priority.
- Parameters
-
| task_ | The task. |
| priority_ | The desired priority. |
task_t task
The task. It is mutable so it can be moved out of the const reference returned by std::priority_queue...
Definition BS_thread_pool.hpp:434
priority_t priority
The priority of the task.
Definition BS_thread_pool.hpp:439
◆ operator<
Compare the priority of two tasks.
- Parameters
-
| lhs | The first task. |
| rhs | The second task. |
- Returns
true if the first task has a lower priority than the second task, false otherwise.
427 {
428 return lhs.priority < rhs.priority;
429 }
The documentation for this struct was generated from the following file: