1#ifndef NEFORCE_CORE_EXCEPTION_ERROR_CONDITION_HPP__
2#define NEFORCE_CORE_EXCEPTION_ERROR_CONDITION_HPP__
14NEFORCE_BEGIN_NAMESPACE__
82 NEFORCE_NODISCARD
int value() const noexcept {
return value_; }
94 NEFORCE_NODISCARD
string message()
const {
return category_->message(value_); }
100 explicit operator bool() const noexcept {
return value_ != 0; }
103 return category_ == rhs.category_ && value_ == rhs.value_;
105 NEFORCE_NODISCARD
bool less_than(
const error_condition& rhs)
const noexcept {
106 if (*category_ < *rhs.category_) {
109 if (*rhs.category_ < *category_) {
112 return value_ < rhs.value_;
125NEFORCE_END_NAMESPACE__
void assign(int val, const error_category &cat) noexcept
赋值错误条件值和类别
error_condition(errc e) noexcept
从 errc 枚举构造
void clear() noexcept
清空错误条件
const error_category & category() const noexcept
获取错误类别
error_condition() noexcept=default
默认构造函数
string message() const
获取错误描述信息
int value() const noexcept
获取错误条件值
const error_category & generic_category() noexcept
获取通用错误类别单例
error_condition make_error_condition(errc e) noexcept
从 errc 枚举创建错误条件