10 bool operator==(
const std::set<T> &A,
const std::set<T> &B)
13 if (A.size() != B.size())
18 typedef typename std::set<T>::const_iterator set_iter;
20 set_iter pA = A.begin();
21 set_iter pB = B.begin();
22 for ( ; pA != A.end(); pA++, pB++)
32 std::set<T>
operator*(
const std::set<T> &A,
const std::set<T> &B)
36 std::set_intersection(A.begin(), A.end(), B.begin(), B.end(),
37 inserter(res, res.begin()));
44 std::set<T> &
operator+=(std::set<T> &A,
const std::set<T> &B)
47 for (
typename std::set<T>::const_iterator p=B.begin(); p!=B.end(); p++)
54 std::set<T> &
operator-=(std::set<T> &A,
const std::set<T> &B)
57 for (
typename std::set<T>::const_iterator p = B.begin(); p!=B.end(); p++)
68 std::set<T>
operator+(
const std::set<T> &A,
const std::set<T> &B)
72 std::set_union(A.begin(), A.end(), B.begin(), B.end(),
73 inserter(res, res.begin()));
83 std::set<T>
operator-(
const std::set<T> &A,
const std::set<T> &B)
87 std::set_difference(A.begin(), A.end(), B.begin(), B.end(),
88 inserter(res, res.begin()));
100 std::set<T>
symm_diff(
const std::set<T> &A,
const std::set<T> &B)
104 std::set_symmetric_difference(A.begin(), A.end(), B.begin(), B.end(),
105 inserter(res, res.begin()));
114 template <
class T,
class constT>
117 return ( (A.find(a) != A.end()) ?
142 typename std::set<T>::const_iterator first1 = A.begin(),
147 for (; first1 != last1 && first2 != last2 ;)
149 if ( *first1 < *first2)
151 else if ( *first2 < *first1 )
174 typename std::set<T>::const_iterator first=B.begin(), last=B.end();
175 for(; first != last; first++)
196 typename std::set<T>::const_iterator first1 = A.begin(),
201 for (; first1 != last1 && first2 != last2 ;)
203 if ( *first1 < *first2)
208 else if ( *first2 < *first1 )