|
ThreadSchedule 3.0.0
Modern C++ thread management library
|
Validated CPU identifier. More...
#include <cpu_id.hpp>
Public Member Functions | |
| constexpr | cpu_id (int value) |
| Construct a CPU id and throw on invalid input. | |
| constexpr auto | value () const noexcept -> std::uint32_t |
| Return the underlying CPU index. | |
Static Public Member Functions | |
| static auto | create (int value) noexcept -> result< cpu_id > |
| Construct a CPU id without exceptions. | |
Friends | |
| constexpr auto | operator== (cpu_id lhs, cpu_id rhs) noexcept -> bool |
| constexpr auto | operator!= (cpu_id lhs, cpu_id rhs) noexcept -> bool |
| constexpr auto | operator< (cpu_id lhs, cpu_id rhs) noexcept -> bool |
Validated CPU identifier.
This type guarantees a non-negative CPU index and is used by thread_affinity to avoid accidental mixing with unrelated integers.
Definition at line 22 of file cpu_id.hpp.
|
inlineexplicitconstexpr |
Construct a CPU id and throw on invalid input.
| value | CPU index, must be >= 0. |
| std::invalid_argument | if value is negative. |
Definition at line 30 of file cpu_id.hpp.
Construct a CPU id without exceptions.
| value | CPU index, must be >= 0. |
errc::invalid_argument. Definition at line 38 of file cpu_id.hpp.
References value().
|
inlineconstexprnoexcept |
Definition at line 58 of file cpu_id.hpp.
Definition at line 62 of file cpu_id.hpp.
Definition at line 53 of file cpu_id.hpp.