diff --git a/alib2data/src/std/set.hpp b/alib2data/src/std/set.hpp index c38b8ad78dbfbf8915771d1600c7a2167f7c8fb7..80778d143db13a825d67673075ab173c4d1c13b1 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_ */