Proposed resolution:
This wording is relative to N4842.
Modify [utility.syn] as indicated:
[Drafting note: This restores the pre-P1614R2 operator== and uses operator<=> as replacement for operator<, operator<=, operator>, operator>=.]
[…] // [pairs], class template pair template<class T1, class T2> struct pair; // [pairs.spec], pair specialized algorithms template<class T1, class T2> constexpr bool operator==(const pair<T1, T2>&, const pair<T1, T2>&); template<class T1, class T2> constexpr common_comparison_category_t<synth-three-way-result<T1>, synth-three-way-result<T2>> operator<=>(const pair<T1, T2>&, const pair<T1, T2>&); template<class T1, class T2> constexpr void swap(pair<T1, T2>& x, pair<T1, T2>& y) noexcept(noexcept(x.swap(y))); […]
Modify [pairs.pair] as indicated:
[…] constexpr void swap(pair& p) noexcept(see below);// [pairs.spec], pair specialized algorithms friend constexpr bool operator==(const pair&, const pair&) = default; friend constexpr bool operator==(const pair& x, const pair& y) requires (is_reference_v<T1> || is_reference_v<T2>) { return x.first == y.first && x.second == y.second; } friend constexpr common_comparison_category_t<synth-three-way-result<T1>, synth-three-way-result<T2>> operator<=>(const pair& x, const pair& y) { see below }}; template<class T1, class T2> pair(T1, T2) -> pair<T1, T2>; […]
Modify [pairs.spec] as indicated:
20.4.3 Specialized algorithms [pairs.spec]
template<class T1, class T2> constexpr bool operator==(const pair<T1, T2>& x, const pair<T1, T2>& y);-?- Returns: x.first == y.first && x.second == y.second.
template<class T1, class T2>friendconstexpr common_comparison_category_t<synth-three-way-result<T1>, synth-three-way-result<T2>> operator<=>(const pair<T1, T2>& x, const pair<T1, T2>& y);-1- Effects: Equivalent to:
if (auto c = synth-three-way(x.first, y.first); c != 0) return c; return synth-three-way(x.second, y.second);
Modify [array.syn] as indicated:
[Drafting note: This restores the pre-P1614R2 operator== and uses operator<=> as replacement for operator<, operator<=, operator>, operator>=.]
namespace std {
// [array], class template array
template<class T, size_t N> struct array;
template<class T, size_t N>
constexpr bool operator==(const array<T, N>& x, const array<T, N>& y);
template<class T, size_t N>
constexpr synth-three-way-result<T>
operator<=>(const array<T, N>& x, const array<T, N>& y);
template<class T, size_t N>
constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
[…]
Modify [array.overview] as indicated:
[Drafting note: there is no need to add definitions of operator== and operator<=> to [array.spec] because they are defined by Table 71: Container requirements [tab:container.req] and Table 73: Optional container operations [tab:container.opt] respectively.]
[…] constexpr T * data() noexcept; constexpr const T * data() const noexcept;friend constexpr bool operator==(const array&, const array&) = default; friend constexpr synth-three-way-result<value_type> operator<=>(const array&, const array&);}; template<class T, class... U> array(T, U...) -> array<T, 1 + sizeof...(U)>; […]