[syserr.compare]

# 19 Diagnostics library [[diagnostics]](./#diagnostics)

## 19.5 System error support [[syserr]](syserr#compare)

### 19.5.6 Comparison operator functions [syserr.compare]

[ð](#lib:operator==,error_code)

`bool operator==(const error_code& lhs, const error_code& rhs) noexcept;
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1438)

*Returns*: lhs.category() == rhs.category() && lhs.value() == rhs.value()

[ð](#lib:operator==,error_condition)

`bool operator==(const error_code& lhs, const error_condition& rhs) noexcept;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1452)

*Returns*: lhs.category().equivalent(lhs.value(), rhs) || rhs.category().equivalent(lhs, rhs.value())

[ð](#lib:operator==,error_condition_)

`bool operator==(const error_condition& lhs, const error_condition& rhs) noexcept;
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1465)

*Returns*: lhs.category() == rhs.category() && lhs.value() == rhs.value()

[ð](#lib:operator%3c=%3e,error_code)

`strong_ordering operator<=>(const error_code& lhs, const error_code& rhs) noexcept;
`

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1478)

*Effects*: Equivalent to:if (auto c = lhs.category() <=> rhs.category(); c != 0) return c;return lhs.value() <=> rhs.value();

[ð](#lib:operator%3c=%3e,error_condition)

`strong_ordering operator<=>(const error_condition& lhs, const error_condition& rhs) noexcept;
`

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1493)

*Returns*: if (auto c = lhs.category() <=> rhs.category(); c != 0) return c;return lhs.value() <=> rhs.value();
