@@ -111,6 +111,11 @@ public:
111111 return _Ptr == _Right._Ptr;
112112 }
113113
114+ #if _HAS_CXX20
115+ _NODISCARD constexpr strong_ordering operator<=>(const _Array_const_iterator& _Right) const noexcept {
116+ return _Ptr <=> _Right._Ptr;
117+ }
118+ #else // ^^^ _HAS_CXX20 ^^^ / vvv !_HAS_CXX20 vvv
114119 _NODISCARD _CONSTEXPR17 bool operator!=(const _Array_const_iterator& _Right) const noexcept {
115120 return !(*this == _Right);
116121 }
@@ -130,6 +135,7 @@ public:
130135 _NODISCARD _CONSTEXPR17 bool operator>=(const _Array_const_iterator& _Right) const noexcept {
131136 return !(*this < _Right);
132137 }
138+ #endif // !_HAS_CXX20
133139
134140 using _Prevent_inheriting_unwrap = _Array_const_iterator;
135141
@@ -235,6 +241,12 @@ private:
235241 return _Idx == _Right._Idx;
236242 }
237243
244+ #if _HAS_CXX20
245+ _NODISCARD constexpr strong_ordering operator<=>(const _Array_const_iterator& _Right) const noexcept {
246+ _Compat(_Right);
247+ return _Idx <=> _Right._Idx;
248+ }
249+ #else // ^^^ _HAS_CXX20 ^^^ / vvv !_HAS_CXX20 vvv
238250 _NODISCARD _CONSTEXPR17 bool operator!=(const _Array_const_iterator& _Right) const noexcept {
239251 return !(*this == _Right);
240252 }
@@ -255,6 +267,7 @@ private:
255267 _NODISCARD _CONSTEXPR17 bool operator>=(const _Array_const_iterator& _Right) const noexcept {
256268 return !(*this < _Right);
257269 }
270+ #endif // !_HAS_CXX20
258271
259272 _CONSTEXPR17 void _Compat(const _Array_const_iterator& _Right) const noexcept { // test for compatible iterator pair
260273 _STL_VERIFY(_Ptr == _Right._Ptr, "array iterators incompatible");
@@ -775,17 +788,41 @@ _CONSTEXPR20 void swap(array<_Ty, _Size>& _Left, array<_Ty, _Size>& _Right) noex
775788
776789template <class _Ty, size_t _Size>
777790_NODISCARD _CONSTEXPR20 bool operator==(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
791+ #ifdef __EDG__ // TRANSITION, VSO-1161663
778792 return _STD equal(_Left.begin(), _Left.end(), _Right.begin());
793+ #else // ^^^ workaround / no workaround vvv
794+ return _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end(), _Right._Unchecked_begin());
795+ #endif // ^^^ no workaround ^^^
779796}
780797
798+ #if !_HAS_CXX20
781799template <class _Ty, size_t _Size>
782- _NODISCARD _CONSTEXPR20 bool operator!=(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
800+ _NODISCARD bool operator!=(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
783801 return !(_Left == _Right);
784802}
803+ #endif // !_HAS_CXX20
785804
805+ #ifdef __cpp_lib_concepts
806+ template <class _Ty, size_t _Size>
807+ _NODISCARD constexpr _Synth_three_way_result<_Ty> operator<=>(
808+ const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
809+ #ifdef __EDG__ // TRANSITION, VSO-1161663
810+ return _STD lexicographical_compare_three_way(
811+ _Left.begin(), _Left.end(), _Right.begin(), _Right.end(), _Synth_three_way{});
812+ #else // ^^^ workaround / no workaround vvv
813+ return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end(),
814+ _Right._Unchecked_begin(), _Right._Unchecked_end(), _Synth_three_way{});
815+ #endif // ^^^ no workaround ^^^
816+ }
817+ #else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv
786818template <class _Ty, size_t _Size>
787819_NODISCARD _CONSTEXPR20 bool operator<(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
820+ #ifdef __EDG__ // TRANSITION, VSO-1161663
788821 return _STD lexicographical_compare(_Left.begin(), _Left.end(), _Right.begin(), _Right.end());
822+ #else // ^^^ workaround / no workaround vvv
823+ return _STD lexicographical_compare(
824+ _Left._Unchecked_begin(), _Left._Unchecked_end(), _Right._Unchecked_begin(), _Right._Unchecked_end());
825+ #endif // ^^^ no workaround ^^^
789826}
790827
791828template <class _Ty, size_t _Size>
@@ -802,6 +839,7 @@ template <class _Ty, size_t _Size>
802839_NODISCARD _CONSTEXPR20 bool operator>=(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) {
803840 return !(_Left < _Right);
804841}
842+ #endif // ^^^ !defined(__cpp_lib_concepts) ^^^
805843
806844#if _HAS_CXX20
807845// FUNCTION TEMPLATE to_array
0 commit comments