File indexing completed on 2025-01-30 09:59:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <boost/regex/config.hpp>
0020 #include <set>
0021
0022 #ifndef BOOST_REGEX_V4_INDEXED_BIT_FLAG_HPP
0023 #define BOOST_REGEX_V4_INDEXED_BIT_FLAG_HPP
0024
0025 namespace boost{
0026 namespace BOOST_REGEX_DETAIL_NS{
0027
0028 class indexed_bit_flag
0029 {
0030 boost::uint64_t low_mask;
0031 std::set<std::size_t> mask_set;
0032 public:
0033 indexed_bit_flag() : low_mask(0) {}
0034 void set(std::size_t i)
0035 {
0036 if (i < std::numeric_limits<boost::uint64_t>::digits - 1)
0037 low_mask |= static_cast<boost::uint64_t>(1u) << i;
0038 else
0039 mask_set.insert(i);
0040 }
0041 bool test(std::size_t i)
0042 {
0043 if (i < std::numeric_limits<boost::uint64_t>::digits - 1)
0044 return low_mask & static_cast<boost::uint64_t>(1u) << i ? true : false;
0045 else
0046 return mask_set.find(i) != mask_set.end();
0047 }
0048 };
0049
0050 }
0051 }
0052
0053
0054 #endif