// (C) Copyright 2008-2009 SDML (www.sdml.info) // // Use, modification and distribution is subject to 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) // Copyright Andrew Sutton 2007 // // Use, modification and distribution are subject to 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_SETS_DYNAMIC_BITSET_RANGE_HPP #define BOOST_SETS_DYNAMIC_BITSET_RANGE_HPP #include namespace boost { // Specialized metafunctions for range. Note that these have to be in // the boost namespace. template struct range_iterator< dynamic_bitset > { typedef sets::bitset_iterator type; }; // The const iterator is the same as the non-const iterator. They're actually // both const. template struct range_const_iterator< dynamic_bitset > { typedef sets::bitset_iterator type; }; // The size type between iterators. template struct range_size< dynamic_bitset > { typedef std::size_t type; }; // Specialize these functions to work with begin() and end(). Note that // dynamic_bitset is in the boost namespace, I need to put these here // as well. // Overloads for non-const bitsets. template sets::bitset_iterator boost_range_begin(dynamic_bitset& bits) { return sets::bitset_iterator(bits); } template sets::bitset_iterator boost_range_end(dynamic_bitset& bits) { return sets::bitset_iterator(bits, bits.size()); } template sets::bitset_iterator boost_range_begin(const dynamic_bitset& bits) { return sets::bitset_iterator(bits); } template sets::bitset_iterator boost_range_end(const dynamic_bitset& bits) { return sets::bitset_iterator(bits, bits.size()); } } /* namespace boost */ #endif