adevs
adevs_set.h
1 
31 #ifndef _adevs_set_h
32 #define _adevs_set_h
33 #include <set>
34 #include <algorithm>
35 
36 namespace adevs
37 {
38 
42 template <class T> class Set: public std::set<T>
43 {
44 };
45 
47 template <class T>
48 void set_assign_diff(Bag<T>& result, const Set<T>& A, const Set<T>& B)
49 {
50  typename Set<T>::const_iterator iter = A.begin();
51  for (; iter != A.end(); iter++)
52  {
53  if (B.find(*iter) == B.end()) result.insert(*iter);
54  }
55 }
56 
57 } // end of namespace
58 
59 #endif
Definition: adevs_set.h:42
void set_assign_diff(Bag< T > &result, const Set< T > &A, const Set< T > &B)
Set difference operator. Returns the set A-B.
Definition: adevs_set.h:48
void insert(const T &t)
Put t into the bag.
Definition: adevs_bag.h:153
Definition: adevs_bag.h:45