From 89bd8de30a5e1d7beb451a3b3190ae861ead380b Mon Sep 17 00:00:00 2001 From: XRay3D Date: Sun, 5 Apr 2026 01:04:16 +0300 Subject: [PATCH] Update clipper.core.h Add three way comparison. Needed to satisfy C++ 26 standard library concepts. --- CPP/Clipper2Lib/include/clipper2/clipper.core.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CPP/Clipper2Lib/include/clipper2/clipper.core.h b/CPP/Clipper2Lib/include/clipper2/clipper.core.h index 99a52054..3508500b 100644 --- a/CPP/Clipper2Lib/include/clipper2/clipper.core.h +++ b/CPP/Clipper2Lib/include/clipper2/clipper.core.h @@ -237,6 +237,10 @@ namespace Clipper2Lib inline void Negate() { x = -x; y = -y; } +#if __cpp_impl_three_way_comparison >= 201907L + constexpr auto operator<=>(const Point&) const = default; +#endif + }; //nb: using 'using' here (instead of typedef) as they can be used in templates @@ -400,6 +404,9 @@ namespace Clipper2Lib os << "(" << rect.left << "," << rect.top << "," << rect.right << "," << rect.bottom << ") "; return os; } +#if __cpp_impl_three_way_comparison >= 201907L + constexpr auto operator<=>(const Rect&) const = default; +#endif }; template