40 [[nodiscard]]
static constexpr auto
51 [[nodiscard]]
static auto
55 return unexpected(std::make_error_code(std::errc::invalid_argument));
60 [[nodiscard]]
constexpr auto
75 return std::max<std::size_t>(1, std::thread::hardware_concurrency());
86 constexpr explicit worker_count(automatic_tag)
noexcept {}
87 constexpr worker_count(unchecked_tag, std::size_t value) noexcept : value_(value) {}
89 [[nodiscard]]
static auto
90 checked(std::size_t value) -> std::size_t
93 throw std::invalid_argument(
"worker_count must be positive");
97 std::size_t value_{ 0 };
Value type for pool worker count.
auto resolve() const noexcept -> std::size_t
Resolve the effective worker count.
worker_count() noexcept=default
Construct automatic worker count.
static constexpr auto automatic() noexcept -> worker_count
Create automatic worker count.
constexpr auto is_automatic() const noexcept -> bool
Return whether this instance uses automatic resolution.
static auto create(std::size_t value) noexcept -> result< worker_count >
Create explicit worker count without exceptions.
Error-returning result type used by the portable ThreadSchedule API.