37 #ifndef NVWA_SET_ASSIGN_H 38 #define NVWA_SET_ASSIGN_H 45 template <
class _Container,
class _InputIter>
46 _Container& set_assign_union(_Container& dest,
50 typename _Container::iterator first_dest = dest.begin();
51 typename _Container::iterator last_dest = dest.end();
52 while (first_dest != last_dest && first != last)
54 if (*first_dest < *first)
56 else if (*first < *first_dest)
58 dest.insert(first_dest, *first);
68 std::copy(first, last, inserter(dest, last_dest));
72 template <
class _Container,
class _InputIter,
class _Compare>
73 _Container& set_assign_union(_Container& dest,
78 typename _Container::iterator first_dest = dest.begin();
79 typename _Container::iterator last_dest = dest.end();
80 while (first_dest != last_dest && first != last)
82 if (comp(*first_dest, *first))
84 else if (comp(*first, *first_dest))
86 dest.insert(first_dest, *first);
96 std::copy(first, last, inserter(dest, last_dest));
100 template <
class _Container,
class _InputIter>
101 _Container& set_assign_difference(_Container& dest,
105 typename _Container::iterator first_dest = dest.begin();
106 typename _Container::iterator last_dest = dest.end();
107 while (first_dest != last_dest && first != last)
109 if (*first_dest < *first)
111 else if (*first < *first_dest)
115 dest.erase(first_dest++);
122 template <
class _Container,
class _InputIter,
class _Compare>
123 _Container& set_assign_difference(_Container& dest,
128 typename _Container::iterator first_dest = dest.begin();
129 typename _Container::iterator last_dest = dest.end();
130 while (first_dest != last_dest && first != last)
132 if (comp(*first_dest, *first))
134 else if (comp(*first, *first_dest))
138 dest.erase(first_dest++);
147 #endif // NVWA_SET_ASSIGN_H Common definitions for preprocessing.