27 set_intersection(S1.begin(),S1.end(),S2.begin(),S2.end(),
28 std::inserter(R,R.begin()));
35 R.insert(S2.begin(), S2.end());
42 std::set_difference(S.begin(), S.end(), notS.begin(), notS.end(),
43 std::inserter(R, R.end()));
55 return std::includes(S1.begin(), S1.end(), S2.begin(), S2.end());
60 #endif // _SETUTIL_H__ static bool setIncludes(const setInt &S1, const setInt &S2)
Checks whether S1 includes S2.
Definition: SetUtil.h:54
static setInt setIntersection(const setInt &S1, const setInt &S2)
Set Intersection.
Definition: SetUtil.h:25
static bool setEqual(const setInt &S1, const setInt &S2)
Checks whether two sets are equal (the == operator can also be used)
Definition: SetUtil.h:49
static setInt setUnion(const setInt &S1, const setInt &S2)
Set Union.
Definition: SetUtil.h:33
static setInt setDifference(const setInt &S, const setInt ¬S)
Set Difference: S \ notS.
Definition: SetUtil.h:40
set< int > setInt
Operations on sets of integers.
Definition: SetUtil.h:11