enum class eq { equal = 0, equivalent = equal, nonequal = 1, nonequivalent = nonequal }; // exposition only enum class ord { less = -1, greater = 1 }; // exposition only enum class ncmp { unordered = -127 }; // exposition only
namespace std { class weak_equality { int value; // exposition only // exposition-only constructor explicit constexpr weak_equality(eq v) noexcept : value(int(v)) {} // exposition only public: // valid values static const weak_equality equivalent; static const weak_equality nonequivalent; // comparisons friend constexpr bool operator==(weak_equality v, unspecified) noexcept; friend constexpr bool operator!=(weak_equality v, unspecified) noexcept; friend constexpr bool operator==(unspecified, weak_equality v) noexcept; friend constexpr bool operator!=(unspecified, weak_equality v) noexcept; friend constexpr weak_equality operator<=>(weak_equality v, unspecified) noexcept; friend constexpr weak_equality operator<=>(unspecified, weak_equality v) noexcept; }; // valid values' definitions inline constexpr weak_equality weak_equality::equivalent(eq::equivalent); inline constexpr weak_equality weak_equality::nonequivalent(eq::nonequivalent); }
constexpr bool operator==(weak_equality v, unspecified) noexcept;
constexpr bool operator==(unspecified, weak_equality v) noexcept;
constexpr bool operator!=(weak_equality v, unspecified) noexcept;
constexpr bool operator!=(unspecified, weak_equality v) noexcept;
constexpr weak_equality operator<=>(weak_equality v, unspecified) noexcept;
constexpr weak_equality operator<=>(unspecified, weak_equality v) noexcept;
namespace std { class strong_equality { int value; // exposition only // exposition-only constructor explicit constexpr strong_equality(eq v) noexcept : value(int(v)) {} // exposition only public: // valid values static const strong_equality equal; static const strong_equality nonequal; static const strong_equality equivalent; static const strong_equality nonequivalent; // conversion constexpr operator weak_equality() const noexcept; // comparisons friend constexpr bool operator==(strong_equality v, unspecified) noexcept; friend constexpr bool operator!=(strong_equality v, unspecified) noexcept; friend constexpr bool operator==(unspecified, strong_equality v) noexcept; friend constexpr bool operator!=(unspecified, strong_equality v) noexcept; friend constexpr strong_equality operator<=>(strong_equality v, unspecified) noexcept; friend constexpr strong_equality operator<=>(unspecified, strong_equality v) noexcept; }; // valid values' definitions inline constexpr strong_equality strong_equality::equal(eq::equal); inline constexpr strong_equality strong_equality::nonequal(eq::nonequal); inline constexpr strong_equality strong_equality::equivalent(eq::equivalent); inline constexpr strong_equality strong_equality::nonequivalent(eq::nonequivalent); }
constexpr operator weak_equality() const noexcept;
constexpr bool operator==(strong_equality v, unspecified) noexcept;
constexpr bool operator==(unspecified, strong_equality v) noexcept;
constexpr bool operator!=(strong_equality v, unspecified) noexcept;
constexpr bool operator!=(unspecified, strong_equality v) noexcept;
constexpr strong_equality operator<=>(strong_equality v, unspecified) noexcept;
constexpr strong_equality operator<=>(unspecified, strong_equality v) noexcept;
namespace std { class partial_ordering { int value; // exposition only bool is_ordered; // exposition only // exposition-only constructors explicit constexpr partial_ordering(eq v) noexcept : value(int(v)), is_ordered(true) {} // exposition only explicit constexpr partial_ordering(ord v) noexcept : value(int(v)), is_ordered(true) {} // exposition only explicit constexpr partial_ordering(ncmp v) noexcept : value(int(v)), is_ordered(false) {} // exposition only public: // valid values static const partial_ordering less; static const partial_ordering equivalent; static const partial_ordering greater; static const partial_ordering unordered; // conversion constexpr operator weak_equality() const noexcept; // comparisons friend constexpr bool operator==(partial_ordering v, unspecified) noexcept; friend constexpr bool operator!=(partial_ordering v, unspecified) noexcept; friend constexpr bool operator< (partial_ordering v, unspecified) noexcept; friend constexpr bool operator> (partial_ordering v, unspecified) noexcept; friend constexpr bool operator<=(partial_ordering v, unspecified) noexcept; friend constexpr bool operator>=(partial_ordering v, unspecified) noexcept; friend constexpr bool operator==(unspecified, partial_ordering v) noexcept; friend constexpr bool operator!=(unspecified, partial_ordering v) noexcept; friend constexpr bool operator< (unspecified, partial_ordering v) noexcept; friend constexpr bool operator> (unspecified, partial_ordering v) noexcept; friend constexpr bool operator<=(unspecified, partial_ordering v) noexcept; friend constexpr bool operator>=(unspecified, partial_ordering v) noexcept; friend constexpr partial_ordering operator<=>(partial_ordering v, unspecified) noexcept; friend constexpr partial_ordering operator<=>(unspecified, partial_ordering v) noexcept; }; // valid values' definitions inline constexpr partial_ordering partial_ordering::less(ord::less); inline constexpr partial_ordering partial_ordering::equivalent(eq::equivalent); inline constexpr partial_ordering partial_ordering::greater(ord::greater); inline constexpr partial_ordering partial_ordering::unordered(ncmp::unordered); }
constexpr operator weak_equality() const noexcept;
constexpr bool operator==(partial_ordering v, unspecified) noexcept;
constexpr bool operator< (partial_ordering v, unspecified) noexcept;
constexpr bool operator> (partial_ordering v, unspecified) noexcept;
constexpr bool operator<=(partial_ordering v, unspecified) noexcept;
constexpr bool operator>=(partial_ordering v, unspecified) noexcept;
constexpr bool operator==(unspecified, partial_ordering v) noexcept;
constexpr bool operator< (unspecified, partial_ordering v) noexcept;
constexpr bool operator> (unspecified, partial_ordering v) noexcept;
constexpr bool operator<=(unspecified, partial_ordering v) noexcept;
constexpr bool operator>=(unspecified, partial_ordering v) noexcept;
constexpr bool operator!=(partial_ordering v, unspecified) noexcept;
constexpr bool operator!=(unspecified, partial_ordering v) noexcept;
constexpr partial_ordering operator<=>(partial_ordering v, unspecified) noexcept;
constexpr partial_ordering operator<=>(unspecified, partial_ordering v) noexcept;
namespace std { class weak_ordering { int value; // exposition only // exposition-only constructors explicit constexpr weak_ordering(eq v) noexcept : value(int(v)) {} // exposition only explicit constexpr weak_ordering(ord v) noexcept : value(int(v)) {} // exposition only public: // valid values static const weak_ordering less; static const weak_ordering equivalent; static const weak_ordering greater; // conversions constexpr operator weak_equality() const noexcept; constexpr operator partial_ordering() const noexcept; // comparisons friend constexpr bool operator==(weak_ordering v, unspecified) noexcept; friend constexpr bool operator!=(weak_ordering v, unspecified) noexcept; friend constexpr bool operator< (weak_ordering v, unspecified) noexcept; friend constexpr bool operator> (weak_ordering v, unspecified) noexcept; friend constexpr bool operator<=(weak_ordering v, unspecified) noexcept; friend constexpr bool operator>=(weak_ordering v, unspecified) noexcept; friend constexpr bool operator==(unspecified, weak_ordering v) noexcept; friend constexpr bool operator!=(unspecified, weak_ordering v) noexcept; friend constexpr bool operator< (unspecified, weak_ordering v) noexcept; friend constexpr bool operator> (unspecified, weak_ordering v) noexcept; friend constexpr bool operator<=(unspecified, weak_ordering v) noexcept; friend constexpr bool operator>=(unspecified, weak_ordering v) noexcept; friend constexpr weak_ordering operator<=>(weak_ordering v, unspecified) noexcept; friend constexpr weak_ordering operator<=>(unspecified, weak_ordering v) noexcept; }; // valid values' definitions inline constexpr weak_ordering weak_ordering::less(ord::less); inline constexpr weak_ordering weak_ordering::equivalent(eq::equivalent); inline constexpr weak_ordering weak_ordering::greater(ord::greater); }
constexpr operator weak_equality() const noexcept;
constexpr operator partial_ordering() const noexcept;
value == 0 ? partial_ordering::equivalent : value < 0 ? partial_ordering::less : partial_ordering::greater
constexpr bool operator==(weak_ordering v, unspecified) noexcept;
constexpr bool operator!=(weak_ordering v, unspecified) noexcept;
constexpr bool operator< (weak_ordering v, unspecified) noexcept;
constexpr bool operator> (weak_ordering v, unspecified) noexcept;
constexpr bool operator<=(weak_ordering v, unspecified) noexcept;
constexpr bool operator>=(weak_ordering v, unspecified) noexcept;
constexpr bool operator==(unspecified, weak_ordering v) noexcept;
constexpr bool operator!=(unspecified, weak_ordering v) noexcept;
constexpr bool operator< (unspecified, weak_ordering v) noexcept;
constexpr bool operator> (unspecified, weak_ordering v) noexcept;
constexpr bool operator<=(unspecified, weak_ordering v) noexcept;
constexpr bool operator>=(unspecified, weak_ordering v) noexcept;
constexpr weak_ordering operator<=>(weak_ordering v, unspecified) noexcept;
constexpr weak_ordering operator<=>(unspecified, weak_ordering v) noexcept;
namespace std { class strong_ordering { int value; // exposition only // exposition-only constructors explicit constexpr strong_ordering(eq v) noexcept : value(int(v)) {} // exposition only explicit constexpr strong_ordering(ord v) noexcept : value(int(v)) {} // exposition only public: // valid values static const strong_ordering less; static const strong_ordering equal; static const strong_ordering equivalent; static const strong_ordering greater; // conversions constexpr operator weak_equality() const noexcept; constexpr operator strong_equality() const noexcept; constexpr operator partial_ordering() const noexcept; constexpr operator weak_ordering() const noexcept; // comparisons friend constexpr bool operator==(strong_ordering v, unspecified) noexcept; friend constexpr bool operator!=(strong_ordering v, unspecified) noexcept; friend constexpr bool operator< (strong_ordering v, unspecified) noexcept; friend constexpr bool operator> (strong_ordering v, unspecified) noexcept; friend constexpr bool operator<=(strong_ordering v, unspecified) noexcept; friend constexpr bool operator>=(strong_ordering v, unspecified) noexcept; friend constexpr bool operator==(unspecified, strong_ordering v) noexcept; friend constexpr bool operator!=(unspecified, strong_ordering v) noexcept; friend constexpr bool operator< (unspecified, strong_ordering v) noexcept; friend constexpr bool operator> (unspecified, strong_ordering v) noexcept; friend constexpr bool operator<=(unspecified, strong_ordering v) noexcept; friend constexpr bool operator>=(unspecified, strong_ordering v) noexcept; friend constexpr strong_ordering operator<=>(strong_ordering v, unspecified) noexcept; friend constexpr strong_ordering operator<=>(unspecified, strong_ordering v) noexcept; }; // valid values' definitions inline constexpr strong_ordering strong_ordering::less(ord::less); inline constexpr strong_ordering strong_ordering::equal(eq::equal); inline constexpr strong_ordering strong_ordering::equivalent(eq::equivalent); inline constexpr strong_ordering strong_ordering::greater(ord::greater); }
constexpr operator weak_equality() const noexcept;
constexpr operator strong_equality() const noexcept;
constexpr operator partial_ordering() const noexcept;
value == 0 ? partial_ordering::equivalent : value < 0 ? partial_ordering::less : partial_ordering::greater
constexpr operator weak_ordering() const noexcept;
value == 0 ? weak_ordering::equivalent : value < 0 ? weak_ordering::less : weak_ordering::greater
constexpr bool operator==(strong_ordering v, unspecified) noexcept;
constexpr bool operator!=(strong_ordering v, unspecified) noexcept;
constexpr bool operator< (strong_ordering v, unspecified) noexcept;
constexpr bool operator> (strong_ordering v, unspecified) noexcept;
constexpr bool operator<=(strong_ordering v, unspecified) noexcept;
constexpr bool operator>=(strong_ordering v, unspecified) noexcept;
constexpr bool operator==(unspecified, strong_ordering v) noexcept;
constexpr bool operator!=(unspecified, strong_ordering v) noexcept;
constexpr bool operator< (unspecified, strong_ordering v) noexcept;
constexpr bool operator> (unspecified, strong_ordering v) noexcept;
constexpr bool operator<=(unspecified, strong_ordering v) noexcept;
constexpr bool operator>=(unspecified, strong_ordering v) noexcept;
constexpr strong_ordering operator<=>(strong_ordering v, unspecified) noexcept;
constexpr strong_ordering operator<=>(unspecified, strong_ordering v) noexcept;