Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 //=======================================================================
2 // Copyright 2002 Indiana University.
3 // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 //=======================================================================
10 #ifndef BOOST_BITSET_ADAPTOR_HPP
11 #define BOOST_BITSET_ADAPTOR_HPP
13 template <class T, class Derived>
14 struct bitset_adaptor {
15 Derived& derived() { return static_cast<Derived&>(*this); }
16 const Derived& derived() const {
17 return static_cast<const Derived&>(*this);
21 template <class T, class D, class V>
22 bool set_contains(const bitset_adaptor<T,D>& s, const V& x) {
23 return s.derived().test(x);
26 template <class T, class D>
27 bool set_equal(const bitset_adaptor<T,D>& x,
28 const bitset_adaptor<T,D>& y) {
29 return x.derived() == y.derived();
32 template <class T, class D>
33 int set_lex_order(const bitset_adaptor<T,D>& x,
34 const bitset_adaptor<T,D>& y) {
35 return compare_3way(x.derived(), y.derived());
38 template <class T, class D>
39 void set_clear(bitset_adaptor<T,D>& x) {
43 template <class T, class D>
44 bool set_empty(const bitset_adaptor<T,D>& x) {
45 return x.derived().none();
48 template <class T, class D, class V>
49 void set_insert(bitset_adaptor<T,D>& x, const V& a) {
53 template <class T, class D, class V>
54 void set_remove(bitset_adaptor<T,D>& x, const V& a) {
55 x.derived().set(a, false);
58 template <class T, class D>
59 void set_intersect(const bitset_adaptor<T,D>& x,
60 const bitset_adaptor<T,D>& y,
61 bitset_adaptor<T,D>& z)
63 z.derived() = x.derived() & y.derived();
66 template <class T, class D>
67 void set_union(const bitset_adaptor<T,D>& x,
68 const bitset_adaptor<T,D>& y,
69 bitset_adaptor<T,D>& z)
71 z.derived() = x.derived() | y.derived();
74 template <class T, class D>
75 void set_difference(const bitset_adaptor<T,D>& x,
76 const bitset_adaptor<T,D>& y,
77 bitset_adaptor<T,D>& z)
79 z.derived() = x.derived() - y.derived();
82 template <class T, class D>
83 void set_compliment(const bitset_adaptor<T,D>& x,
84 bitset_adaptor<T,D>& z)
86 z.derived() = x.derived();
90 #endif // BOOST_BITSET_ADAPTOR_HPP