operator==,!=,<,<=>(std::error_condition)
Определён в заголовочном файле <system_error> | ||
|---|---|---|
bool operator==( const std::error_condition& lhs,
const std::error_condition& rhs ) noexcept;
| (1) | (начиная с C++11) |
bool operator!=( const std::error_condition& lhs,
const std::error_condition& rhs ) noexcept;
| (2) | (начиная с C++11) (до C++20) |
bool operator<( const std::error_condition& lhs,
const std::error_condition& rhs ) noexcept;
| (3) | (начиная с C++11) (до C++20) |
std::strong_ordering operator<=>( const std::error_condition& lhs,
const std::error_condition& rhs ) noexcept;
| (4) | (начиная с C++20) |
bool operator==( const std::error_code& code,
const std::error_condition& cond ) noexcept;
| (5) | (начиная с C++11) |
bool operator==( const std::error_condition& cond,
const std::error_code& code ) noexcept;
| (5) | (начиная с C++11) (до C++20) |
bool operator!=( const std::error_code& code,
const std::error_condition& cond ) noexcept;
| (6) | (начиная с C++11) (до C++20) |
bool operator!=( const std::error_condition& cond,
const std::error_code& code ) noexcept;
| (6) | (начиная с C++11) (до C++20) |
Сравнивает два условия ошибки.
1) Проверяет, равны ли
lhs и rhs.
2) Проверяет, не равны ли
lhs и rhs.
3) Проверяет, меньше ли
lhs, чем rhs.
4) Получает результат трёхстороннего сравнения
lhs и rhs.
5) Проверяет, является ли
code семантически эквивалентным cond.
6) Проверяет, не является ли
code семантически эквивалентным cond.| Операторы | (начиная с C++20) |
Параметры
| lhs, rhs, cond | - | условия ошибки для сравнения |
| code | - | код ошибки для сравнения |
Возвращаемое значение
1)
true, если категории ошибки и значения ошибки равны.
2)
true, если категории ошибки или значения ошибки не равны.
3)
true, если lhs.category() < rhs.category(). В противном случае true, если lhs.category() == rhs.category() && lhs.value() < rhs.value(). В противном случае false.
4)
lhs.category() <=> rhs.category(), если это не std::strong_ordering::equal. В противном случае lhs.value() <=> rhs.value().
5)
true, если выполняется хотя бы одно из условий: code.category().equivalent(code.value(), cond) или cond.category().equivalent(code, cond.value()).
6)
true, если не выполняется ни code.category().equivalent(code.value(), cond), ни cond.category().equivalent(code, cond.value()).См. также
|
[виртуальная] | сравнивает error_code и error_condition на эквивалентность (виртуальная открытая функция-член класса std::error_category) |
|
(удалён в C++20)(удалён в C++20)(C++20) | сравнивает два error_code (функция) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/error/error_condition/operator_cmp