6 * Use, modification and distribution are subject to the
7 * Boost Software License, Version 1.0. (See accompanying file
8 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
13 * LOCATION: see http://www.boost.org for most recent version.
14 * FILE basic_regex_parser.cpp
15 * VERSION see <boost/version.hpp>
16 * DESCRIPTION: Declares template class basic_regex_parser.
19 #include <boost/regex/config.hpp>
22 #ifndef BOOST_REGEX_V4_INDEXED_BIT_FLAG_HPP
23 #define BOOST_REGEX_V4_INDEXED_BIT_FLAG_HPP
26 namespace BOOST_REGEX_DETAIL_NS{
28 class indexed_bit_flag
30 boost::uint64_t low_mask;
31 std::set<std::size_t> mask_set;
33 indexed_bit_flag() : low_mask(0) {}
34 void set(std::size_t i)
36 if (i < std::numeric_limits<boost::uint64_t>::digits - 1)
37 low_mask |= static_cast<boost::uint64_t>(1u) << i;
41 bool test(std::size_t i)
43 if (i < std::numeric_limits<boost::uint64_t>::digits - 1)
44 return low_mask & static_cast<boost::uint64_t>(1u) << i ? true : false;
46 return mask_set.find(i) != mask_set.end();
50 } // namespace BOOST_REGEX_DETAIL_NS