38 [[nodiscard]]
static auto
42 return unexpected(std::make_error_code(std::errc::invalid_argument));
47 [[nodiscard]]
constexpr auto
56 return lhs.value_ == rhs.value_;
70 [[nodiscard]]
static constexpr auto
71 checked(
int value) ->
int
74 throw std::invalid_argument(
"nice_value must be in the range -20..19");
static constexpr int minimum
Lowest accepted nice value (highest priority).
friend constexpr auto operator!=(nice_value lhs, nice_value rhs) noexcept -> bool
constexpr auto value() const noexcept -> int
Return the wrapped nice value.
friend constexpr auto operator==(nice_value lhs, nice_value rhs) noexcept -> bool
constexpr nice_value(int value)
Construct and validate a nice value.
static auto create(int value) noexcept -> result< nice_value >
Construct a nice value without exceptions.
static constexpr int maximum
Highest accepted nice value (lowest priority).
unexpected(E) -> unexpected< E >
expected< T, std::error_code > result
Standard result type used by public APIs.
Error-returning result type used by the portable ThreadSchedule API.