Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // (C) Copyright Jeremy Siek 2001.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 #ifndef BOOST_SET_ADAPTOR_HPP
7 #define BOOST_SET_ADAPTOR_HPP
13 template <class K, class C, class A, class T>
14 bool set_contains(const std::set<K,C,A>& s, const T& x) {
15 return s.find(x) != s.end();
18 template <class K, class C, class A>
19 bool set_equal(const std::set<K,C,A>& x,
20 const std::set<K,C,A>& y)
25 // Not the same as lexicographical_compare_3way applied to std::set.
26 // this is equivalent semantically to bitset::operator<()
27 template <class K, class C, class A>
28 int set_lex_order(const std::set<K,C,A>& x,
29 const std::set<K,C,A>& y)
31 typename std::set<K,C,A>::iterator
32 xi = x.begin(), yi = y.begin(), xend = x.end(), yend = y.end();
33 for (; xi != xend && yi != yend; ++xi, ++yi) {
40 return (yi == yend) ? 0 : -1;
45 template <class K, class C, class A>
46 void set_clear(std::set<K,C,A>& x) {
50 template <class K, class C, class A>
51 bool set_empty(const std::set<K,C,A>& x) {
55 template <class K, class C, class A, class T>
56 void set_insert(std::set<K,C,A>& x, const T& a) {
60 template <class K, class C, class A, class T>
61 void set_remove(std::set<K,C,A>& x, const T& a) {
65 template <class K, class C, class A>
66 void set_intersect(const std::set<K,C,A>& x,
67 const std::set<K,C,A>& y,
71 std::set_intersection(x.begin(), x.end(),
76 template <class K, class C, class A>
77 void set_union(const std::set<K,C,A>& x,
78 const std::set<K,C,A>& y,
82 std::set_union(x.begin(), x.end(),
87 template <class K, class C, class A>
88 void set_difference(const std::set<K,C,A>& x,
89 const std::set<K,C,A>& y,
93 std::set_difference(x.begin(), x.end(),
95 std::inserter(z, z.begin()));
98 template <class K, class C, class A>
99 bool set_subset(const std::set<K,C,A>& x,
100 const std::set<K,C,A>& y)
102 return std::includes(x.begin(), x.end(), y.begin(), y.end());
105 // Shit, can't implement this without knowing the size of the
107 template <class K, class C, class A>
108 void set_compliment(const std::set<K,C,A>& x,
117 #endif // BOOST_SET_ADAPTOR_HPP