From dde4ff24f5f4d59cf999f3d3de1a4afa40d08525 Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Sun, 21 Sep 2014 11:11:11 +0200
Subject: [PATCH] empty_intersection for sets

---
 alib2data/src/std/set.hpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/alib2data/src/std/set.hpp b/alib2data/src/std/set.hpp
index c38b8ad78d..80778d143d 100644
--- a/alib2data/src/std/set.hpp
+++ b/alib2data/src/std/set.hpp
@@ -34,6 +34,21 @@ std::ostream& operator<<(std::ostream& out, const std::set<T>& list) {
 	return out;
 }
 
+template<class T>
+bool empty_intersection(const set<T>& x, const set<T>& y) {
+	auto i = x.begin();
+	auto j = y.begin();
+	while (i != x.end() && j != y.end()) {
+		if (*i == *j)
+			return false;
+		else if (*i < *j)
+			++i;
+		else
+			++j;
+	}
+	return true;
+}
+
 } /* namespace std */
 
 #endif /* __SET_HPP_ */
-- 
GitLab