diff -r 000000000000 -r e4d67989cc36 ossrv_pub/boost_apis/boost/graph/detail/bitset_adaptor.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ossrv_pub/boost_apis/boost/graph/detail/bitset_adaptor.hpp Tue Feb 02 02:01:42 2010 +0200 @@ -0,0 +1,90 @@ +//======================================================================= +// Copyright 2002 Indiana University. +// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +//======================================================================= + +#ifndef BOOST_BITSET_ADAPTOR_HPP +#define BOOST_BITSET_ADAPTOR_HPP + + template + struct bitset_adaptor { + Derived& derived() { return static_cast(*this); } + const Derived& derived() const { + return static_cast(*this); + } + }; + + template + bool set_contains(const bitset_adaptor& s, const V& x) { + return s.derived().test(x); + } + + template + bool set_equal(const bitset_adaptor& x, + const bitset_adaptor& y) { + return x.derived() == y.derived(); + } + + template + int set_lex_order(const bitset_adaptor& x, + const bitset_adaptor& y) { + return compare_3way(x.derived(), y.derived()); + } + + template + void set_clear(bitset_adaptor& x) { + x.derived().reset(); + } + + template + bool set_empty(const bitset_adaptor& x) { + return x.derived().none(); + } + + template + void set_insert(bitset_adaptor& x, const V& a) { + x.derived().set(a); + } + + template + void set_remove(bitset_adaptor& x, const V& a) { + x.derived().set(a, false); + } + + template + void set_intersect(const bitset_adaptor& x, + const bitset_adaptor& y, + bitset_adaptor& z) + { + z.derived() = x.derived() & y.derived(); + } + + template + void set_union(const bitset_adaptor& x, + const bitset_adaptor& y, + bitset_adaptor& z) + { + z.derived() = x.derived() | y.derived(); + } + + template + void set_difference(const bitset_adaptor& x, + const bitset_adaptor& y, + bitset_adaptor& z) + { + z.derived() = x.derived() - y.derived(); + } + + template + void set_compliment(const bitset_adaptor& x, + bitset_adaptor& z) + { + z.derived() = x.derived(); + z.derived().flip(); + } + +#endif // BOOST_BITSET_ADAPTOR_HPP