namespace std {
struct strong_ordering {
int n;
constexpr operator int() const { return n; }
static const strong_ordering less, equal, greater;
};
constexpr strong_ordering strong_ordering::less = {-1};
constexpr strong_ordering strong_ordering::equal = {0};
constexpr strong_ordering strong_ordering::greater = {1};
}
struct A {
friend bool operator==(const A&, const A&) = default;
friend bool operator!=(const A&, const A&) = default;
friend std::strong_ordering operator<=>(const A&, const A&) = default;
friend bool operator<(const A&, const A&) = default;
friend bool operator<=(const A&, const A&) = default;
friend bool operator>(const A&, const A&) = default;
friend bool operator>=(const A&, const A&) = default;
};
struct TestA {
friend constexpr bool operator==(const A&, const A&) noexcept;
friend constexpr bool operator!=(const A&, const A&) noexcept;
friend constexpr std::strong_ordering operator<=>(const A&, const A&) noexcept;
friend constexpr bool operator<(const A&, const A&);
friend constexpr bool operator<=(const A&, const A&);
friend constexpr bool operator>(const A&, const A&);
friend constexpr bool operator>=(const A&, const A&);
};
struct ReversedA {
friend bool operator>=(const ReversedA&, const ReversedA&) = default;
friend bool operator>(const ReversedA&, const ReversedA&) = default;
friend bool operator<=(const ReversedA&, const ReversedA&) = default;
friend bool operator<(const ReversedA&, const ReversedA&) = default;
friend std::strong_ordering operator<=>(const ReversedA&, const ReversedA&) = default;
friend bool operator!=(const ReversedA&, const ReversedA&) = default;
friend bool operator==(const ReversedA&, const ReversedA&) = default;
};
struct TestReversedA {
friend constexpr bool operator>=(const ReversedA&, const ReversedA&);
friend constexpr bool operator>(const ReversedA&, const ReversedA&);
friend constexpr bool operator<=(const ReversedA&, const ReversedA&);
friend constexpr bool operator<(const ReversedA&, const ReversedA&);
friend constexpr std::strong_ordering operator<=>(const ReversedA&, const ReversedA&) noexcept;
friend constexpr bool operator!=(const ReversedA&, const ReversedA&) noexcept;
friend constexpr bool operator==(const ReversedA&, const ReversedA&) noexcept;
};
struct B {
A a;
friend bool operator==(const B&, const B&) = default;
friend bool operator!=(const B&, const B&) = default;
friend std::strong_ordering operator<=>(const B&, const B&) = default;
friend bool operator<(const B&, const B&) = default;
friend bool operator<=(const B&, const B&) = default;
friend bool operator>(const B&, const B&) = default;
friend bool operator>=(const B&, const B&) = default;
};
struct TestB {
friend constexpr bool operator==(const B&, const B&) noexcept;
friend constexpr bool operator!=(const B&, const B&) noexcept;
friend constexpr std::strong_ordering operator<=>(const B&, const B&);
friend constexpr bool operator<(const B&, const B&);
friend constexpr bool operator<=(const B&, const B&);
friend constexpr bool operator>(const B&, const B&);
friend constexpr bool operator>=(const B&, const B&);
};
struct C {
friend bool operator==(const C&, const C&); friend bool operator!=(const C&, const C&) = default;
friend std::strong_ordering operator<=>(const C&, const C&); friend bool operator<(const C&, const C&) = default; friend bool operator<=(const C&, const C&) = default; friend bool operator>(const C&, const C&) = default; friend bool operator>=(const C&, const C&) = default; };
struct TestC {
friend constexpr bool operator==(const C&, const C&); friend constexpr bool operator!=(const C&, const C&);
friend constexpr std::strong_ordering operator<=>(const C&, const C&); friend constexpr bool operator<(const C&, const C&); friend constexpr bool operator<=(const C&, const C&); friend constexpr bool operator>(const C&, const C&); friend constexpr bool operator>=(const C&, const C&); };
struct D {
A a;
C c;
A b;
friend bool operator==(const D&, const D&) = default; friend bool operator!=(const D&, const D&) = default;
friend std::strong_ordering operator<=>(const D&, const D&) = default; friend bool operator<(const D&, const D&) = default; friend bool operator<=(const D&, const D&) = default; friend bool operator>(const D&, const D&) = default; friend bool operator>=(const D&, const D&) = default; };
struct TestD {
friend constexpr bool operator==(const D&, const D&); friend constexpr bool operator!=(const D&, const D&);
friend constexpr std::strong_ordering operator<=>(const D&, const D&); friend constexpr bool operator<(const D&, const D&); friend constexpr bool operator<=(const D&, const D&); friend constexpr bool operator>(const D&, const D&); friend constexpr bool operator>=(const D&, const D&); };
struct E {
A a;
C c; A b;
friend constexpr bool operator==(const E&, const E&) = default; friend constexpr bool operator!=(const E&, const E&) = default;
friend constexpr std::strong_ordering operator<=>(const E&, const E&) = default; friend constexpr bool operator<(const E&, const E&) = default;
friend constexpr bool operator<=(const E&, const E&) = default;
friend constexpr bool operator>(const E&, const E&) = default;
friend constexpr bool operator>=(const E&, const E&) = default;
};
struct E2 : A, C { friend constexpr bool operator==(const E2&, const E2&) = default; friend constexpr bool operator!=(const E2&, const E2&) = default;
friend constexpr std::strong_ordering operator<=>(const E2&, const E2&) = default; friend constexpr bool operator<(const E2&, const E2&) = default;
friend constexpr bool operator<=(const E2&, const E2&) = default;
friend constexpr bool operator>(const E2&, const E2&) = default;
friend constexpr bool operator>=(const E2&, const E2&) = default;
};
struct F {
friend bool operator==(const F&, const F&); friend constexpr bool operator!=(const F&, const F&) = default;
friend std::strong_ordering operator<=>(const F&, const F&); friend constexpr bool operator<(const F&, const F&) = default; friend constexpr bool operator<=(const F&, const F&) = default; friend constexpr bool operator>(const F&, const F&) = default; friend constexpr bool operator>=(const F&, const F&) = default; };
struct G;
bool operator==(const G&, const G&);
bool operator!=(const G&, const G&);
std::strong_ordering operator<=>(const G&, const G&);
bool operator<(const G&, const G&);
bool operator<=(const G&, const G&);
bool operator>(const G&, const G&);
bool operator>=(const G&, const G&);
struct G {
friend bool operator==(const G&, const G&) = default;
friend bool operator!=(const G&, const G&) = default;
friend std::strong_ordering operator<=>(const G&, const G&) = default;
friend bool operator<(const G&, const G&) = default;
friend bool operator<=(const G&, const G&) = default;
friend bool operator>(const G&, const G&) = default;
friend bool operator>=(const G&, const G&) = default;
};
bool operator==(const G&, const G&);
bool operator!=(const G&, const G&);
std::strong_ordering operator<=>(const G&, const G&);
bool operator<(const G&, const G&);
bool operator<=(const G&, const G&);
bool operator>(const G&, const G&);
bool operator>=(const G&, const G&);
namespace PR44721 {
template <typename T> bool operator==(T const &, T const &) { return true; }
template <typename T, typename U> bool operator!=(T const &, U const &) { return true; }
template <typename T> int operator<=>(T const &, T const &) { return 0; }
struct S {
friend bool operator==(const S &, const S &) = default;
friend bool operator<=>(const S &, const S &) = default;
int x;
};
}