Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:59:26

0001 /*
0002  *
0003  * Copyright (c) 2020
0004  * John Maddock
0005  *
0006  * Use, modification and distribution are subject to the 
0007  * Boost Software License, Version 1.0. (See accompanying file 
0008  * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009  *
0010  */
0011 
0012  /*
0013   *   LOCATION:    see http://www.boost.org for most recent version.
0014   *   FILE         basic_regex_parser.cpp
0015   *   VERSION      see <boost/version.hpp>
0016   *   DESCRIPTION: Declares template class basic_regex_parser.
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 } // namespace BOOST_REGEX_DETAIL_NS
0051 } // namespace boost
0052 
0053 
0054 #endif