--- src/martinez.h.orig	2024-03-16 17:56:04
+++ src/martinez.h	2025-05-05 16:05:10
@@ -17,6 +17,7 @@
 #include <queue>
 #include <vector>
 #include <set>
+#include <functional>
 
 using namespace std;
 
@@ -37,7 +38,7 @@
 	enum PolygonType { SUBJECT, CLIPPING };
 
 	struct SweepEvent;
-	struct SegmentComp : public binary_function<SweepEvent*, SweepEvent*, bool> { // for sorting edges in the sweep line
+	struct SegmentComp : public std::function<bool(SweepEvent*, SweepEvent*)> { // for sorting edges in the sweep line
 		bool operator() (SweepEvent* e1, SweepEvent* e2) const;
 	};
 	
@@ -64,7 +65,7 @@
 	
 	static void print (SweepEvent& e); // This function is intended for debugging purposes
 
-	struct SweepEventComp : public binary_function<SweepEvent*, SweepEvent*, bool> { // for sortening events
+	struct SweepEventComp : public std::function<bool(SweepEvent*, SweepEvent*)> { // for sortening events
 		bool operator() (SweepEvent* e1, SweepEvent* e2) const;
 	};
 
--- src/polygon.cpp.orig	2024-03-16 17:56:04
+++ src/polygon.cpp	2025-05-05 16:04:51
@@ -12,6 +12,7 @@
 #include <set>
 #include <cstdlib>
 #include <algorithm>
+#include <functional>
 
 void Contour::boundingbox (Point& min, Point& max)
 {
@@ -93,7 +94,7 @@
 
 namespace { // start of anonymous namespace
 	struct SweepEvent;
-	struct SegmentComp : public binary_function<SweepEvent*, SweepEvent*, bool> {
+	struct SegmentComp : public std::function<bool(SweepEvent*, SweepEvent*)> {
 		bool operator() (SweepEvent* e1, SweepEvent* e2) const;
 	};
 
@@ -116,7 +117,7 @@
 		bool above (const Point& x) const { return !below (x); }
 	};
 
-	struct SweepEventComp : public binary_function<SweepEvent*, SweepEvent*, bool> {
+	struct SweepEventComp : public std::function<bool(SweepEvent*, SweepEvent*)> {
 		bool operator() (SweepEvent* e1, SweepEvent* e2) const {
 			if (e1->p.x < e2->p.x) // Different x coordinate
 				return true;
