This is an automated email from the ASF dual-hosted git repository.

bmahler pushed a commit to branch 1.7.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 0de383ca1cfbd77c2f25f6372e3a10292d6ecbac
Author: Andrei Sekretenko <[email protected]>
AuthorDate: Mon Jul 1 15:18:50 2019 -0400

    Added 'operator-()' for set difference to stout.
    
    Review: https://reviews.apache.org/r/70974/
---
 3rdparty/stout/include/stout/set.hpp | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/3rdparty/stout/include/stout/set.hpp 
b/3rdparty/stout/include/stout/set.hpp
index 96238a7..764fc3c 100644
--- a/3rdparty/stout/include/stout/set.hpp
+++ b/3rdparty/stout/include/stout/set.hpp
@@ -13,7 +13,7 @@
 #ifndef __STOUT_SET_HPP__
 #define __STOUT_SET_HPP__
 
-#include <algorithm> // For std::set_intersection.
+#include <algorithm> // For std::set_intersection and std::set_difference.
 #include <set>
 
 template <typename T>
@@ -49,4 +49,18 @@ std::set<T> operator&(const std::set<T>& left, const 
std::set<T>& right)
   return result;
 }
 
+
+template <typename T>
+std::set<T> operator-(const std::set<T>& left, const std::set<T>& right)
+{
+  std::set<T> result;
+  std::set_difference(
+      left.begin(),
+      left.end(),
+      right.begin(),
+      right.end(),
+      std::inserter(result, result.begin()));
+  return result;
+}
+
 #endif // __STOUT_SET_HPP__

Reply via email to