33 template<
class K,
class Comp>
41 template<
class K,
class Comp>
45 return intersection( that );
53 template<
class K,
class Comp>
65 template<
class K,
class Comp>
69 return difference( that );
77 template<
class K,
class Comp>
81 return symetric_difference( that );
90 template<
class K,
class Comp>
94 return strictly_contains( that );
103 template<
class K,
class Comp>
107 return contains( that );
116 template<
class K,
class Comp>
129 template<
class K,
class Comp>
141 template<
class K,
class Comp>
145 std::list<K> remove_us;
148 for (it=super::begin(); it!=super::end(); ++it)
149 if ( that.
find( *it ) == that.
end() )
150 remove_us.push_front( *it );
152 typename std::list<K>::const_iterator remove_it;
154 for (remove_it=remove_us.begin(); remove_it!=remove_us.end(); ++remove_it)
155 super::erase( *remove_it );
165 template<
class K,
class Comp>
171 for (it=that.
begin(); it!=that.
end(); ++it)
172 super::insert( *it );
182 template<
class K,
class Comp>
186 std::list<K> remove_us;
189 for (it=super::begin(); it!=super::end(); ++it)
190 if ( that.
find( *it ) != that.
end() )
191 remove_us.push_front( *it );
193 typename std::list<K>::const_iterator remove_it;
195 for (remove_it=remove_us.begin(); remove_it!=remove_us.end(); ++remove_it)
196 super::erase( *remove_it );
206 template<
class K,
class Comp>
212 return difference( that ).join( his_copy.
difference(my_copy) );
221 template<
class K,
class Comp>
225 bool ok = super::size() >= that.
size();
229 while ( ok && (it_that != that.
end()) && (it_this != super::end()) )
230 if ( s_key_comp( *it_this, *it_that ) )
232 else if ( s_key_comp( *it_that, *it_this ) )
240 return it_that == that.
end();
249 template<
class K,
class Comp>
254 return contains(that) && ( super::size() > that.
size() );
ordered_set & operator*=(const ordered_set &that)
Intersection.
unsigned int size() const
Get the size of a tree.
ordered_set & operator-=(const ordered_set &that)
Difference.
ordered_set & join(const ordered_set &that)
Union.
const_iterator end() const
Get an iterator after the end of the tree.
bool strictly_contains(const ordered_set &that) const
Inclusion.
ordered_set & operator/=(const ordered_set &that)
Symetric difference.
bool operator>=(const ordered_set &that) const
Inclusion or equality.
bool operator<=(const ordered_set &that) const
Inclusion or equality.
bool operator>(const ordered_set &that) const
Inclusion.
bool operator<(const ordered_set &that) const
Inclusion.
ordered_set & operator+=(const ordered_set &that)
Union.
bool contains(const ordered_set &that) const
Inclusion or equality.
A class to manage sets of ordered items.
const_iterator find(const K &key) const
Get an iterator on the nodes of the tree from a specified key.
ordered_set & difference(const ordered_set &that)
Difference.
ordered_set & symetric_difference(const ordered_set &that)
Symetric difference.
ordered_set & intersection(const ordered_set &that)
Intersection.
const_iterator begin() const
Get an iterator on the nodes of the tree.