Skip to content

Commit df07d1b

Browse files
Apply suggestions from code review
Co-authored-by: Stephan T. Lavavej <[email protected]>
1 parent b82c9dc commit df07d1b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stl/inc/system_error

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#ifndef _M_CEE_PURE
1818
#include <atomic>
1919
#include <compare>
20-
#endif
20+
#endif // _M_CEE_PURE
2121

2222
#pragma pack(push, _CRT_PACKING)
2323
#pragma warning(push, _STL_WARNING_LEVEL)
@@ -100,7 +100,7 @@ public:
100100
// TRANSITION, GH-489
101101
#ifdef __cpp_lib_concepts
102102
_NODISCARD strong_ordering operator<=>(const error_category& _Right) const noexcept {
103-
return compare_three_way()(this, &_Right);
103+
return compare_three_way{}(_Addr, _Right._Addr);
104104
}
105105
#else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv
106106
_NODISCARD bool operator<(const error_category& _Right) const noexcept {
@@ -186,7 +186,7 @@ public:
186186
// TRANSITION, GH-489
187187
#ifdef __cpp_lib_concepts
188188
_NODISCARD friend strong_ordering operator<=>(const error_code& _Left, const error_code& _Right) noexcept {
189-
if (auto _Result = _Left.category() <=> _Right.category(); _Result != 0) {
189+
if (const auto _Result = _Left.category() <=> _Right.category(); _Result != 0) {
190190
return _Result;
191191
}
192192
return _Left.value() <=> _Right.value();
@@ -274,7 +274,7 @@ public:
274274
#ifdef __cpp_lib_concepts
275275
_NODISCARD friend strong_ordering operator<=>(
276276
const error_condition& _Left, const error_condition& _Right) noexcept {
277-
if (auto _Result = _Left.category() <=> _Right.category(); _Result != 0) {
277+
if (const auto _Result = _Left.category() <=> _Right.category(); _Result != 0) {
278278
return _Result;
279279
}
280280
return _Left.value() <=> _Right.value();

0 commit comments

Comments
 (0)