SILENT KILLERPanel

Current Path: > > usr > include > c++ > > 8 > bits


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //usr/include/c++//8/bits

NameTypeSizeLast ModifiedActions
algorithmfwd.h File 21736 bytes March 31 2025 10:36:16.
alloc_traits.h File 20066 bytes March 31 2025 10:36:16.
allocated_ptr.h File 3293 bytes March 31 2025 10:36:16.
allocator.h File 7569 bytes March 31 2025 10:36:16.
atomic_base.h File 23842 bytes March 31 2025 10:36:16.
atomic_futex.h File 9576 bytes March 31 2025 10:36:16.
atomic_lockfree_defines.h File 2253 bytes March 31 2025 10:36:18.
basic_ios.h File 16074 bytes March 31 2025 10:36:16.
basic_ios.tcc File 6083 bytes March 31 2025 10:36:16.
basic_string.h File 242697 bytes March 31 2025 10:36:16.
basic_string.tcc File 53755 bytes March 31 2025 10:36:16.
boost_concept_check.h File 27161 bytes March 31 2025 10:36:16.
c++0x_warning.h File 1474 bytes March 31 2025 10:36:16.
char_traits.h File 20915 bytes March 31 2025 10:36:16.
codecvt.h File 21289 bytes March 31 2025 10:36:16.
concept_check.h File 3423 bytes March 31 2025 10:36:16.
cpp_type_traits.h File 9789 bytes March 31 2025 10:36:16.
cxxabi_forced.h File 1811 bytes March 31 2025 10:36:18.
cxxabi_init_exception.h File 2220 bytes March 31 2025 10:36:18.
deque.tcc File 34122 bytes March 31 2025 10:36:16.
enable_special_members.h File 12387 bytes March 31 2025 10:36:16.
exception.h File 2280 bytes March 31 2025 10:36:18.
exception_defines.h File 1645 bytes March 31 2025 10:36:18.
exception_ptr.h File 5981 bytes March 31 2025 10:36:18.
forward_list.h File 48919 bytes March 31 2025 10:36:16.
forward_list.tcc File 13169 bytes March 31 2025 10:36:16.
fs_dir.h File 14724 bytes March 31 2025 10:36:16.
fs_fwd.h File 10279 bytes March 31 2025 10:36:16.
fs_ops.h File 9730 bytes March 31 2025 10:36:16.
fs_path.h File 32894 bytes March 31 2025 10:36:16.
fstream.tcc File 32799 bytes March 31 2025 10:36:16.
functexcept.h File 3254 bytes March 31 2025 10:36:16.
functional_hash.h File 8238 bytes March 31 2025 10:36:16.
gslice.h File 5518 bytes March 31 2025 10:36:16.
gslice_array.h File 7769 bytes March 31 2025 10:36:16.
hash_bytes.h File 2146 bytes March 31 2025 10:36:18.
hashtable.h File 73785 bytes March 31 2025 10:36:16.
hashtable_policy.h File 67971 bytes March 31 2025 10:36:16.
indirect_array.h File 7861 bytes March 31 2025 10:36:16.
invoke.h File 3657 bytes March 31 2025 10:36:16.
ios_base.h File 31023 bytes March 31 2025 10:36:16.
istream.tcc File 31093 bytes March 31 2025 10:36:16.
list.tcc File 15976 bytes March 31 2025 10:36:16.
locale_classes.h File 24897 bytes March 31 2025 10:36:16.
locale_classes.tcc File 8375 bytes March 31 2025 10:36:16.
locale_conv.h File 16097 bytes March 31 2025 10:36:16.
locale_facets.h File 92328 bytes March 31 2025 10:36:16.
locale_facets.tcc File 39548 bytes March 31 2025 10:36:16.
locale_facets_nonio.h File 68980 bytes March 31 2025 10:36:16.
locale_facets_nonio.tcc File 45280 bytes March 31 2025 10:36:16.
localefwd.h File 5646 bytes March 31 2025 10:36:16.
mask_array.h File 7595 bytes March 31 2025 10:36:16.
memoryfwd.h File 2453 bytes March 31 2025 10:36:16.
move.h File 6529 bytes March 31 2025 10:36:16.
nested_exception.h File 4802 bytes March 31 2025 10:36:18.
node_handle.h File 8216 bytes March 31 2025 10:36:16.
ostream.tcc File 12315 bytes March 31 2025 10:36:16.
ostream_insert.h File 4002 bytes March 31 2025 10:36:16.
parse_numbers.h File 7944 bytes March 31 2025 10:36:16.
postypes.h File 8208 bytes March 31 2025 10:36:16.
predefined_ops.h File 9083 bytes March 31 2025 10:36:16.
ptr_traits.h File 6626 bytes March 31 2025 10:36:16.
quoted_string.h File 5053 bytes March 31 2025 10:36:16.
random.h File 175250 bytes March 31 2025 10:36:16.
random.tcc File 105590 bytes March 31 2025 10:36:16.
range_access.h File 10030 bytes March 31 2025 10:36:16.
refwrap.h File 11884 bytes March 31 2025 10:36:16.
regex.h File 97402 bytes March 31 2025 10:36:16.
regex.tcc File 16565 bytes March 31 2025 10:36:16.
regex_automaton.h File 10722 bytes March 31 2025 10:36:16.
regex_automaton.tcc File 7838 bytes March 31 2025 10:36:16.
regex_compiler.h File 18050 bytes March 31 2025 10:36:16.
regex_compiler.tcc File 19288 bytes March 31 2025 10:36:16.
regex_constants.h File 14708 bytes March 31 2025 10:36:16.
regex_error.h File 4904 bytes March 31 2025 10:36:16.
regex_executor.h File 7488 bytes March 31 2025 10:36:16.
regex_executor.tcc File 18841 bytes March 31 2025 10:36:16.
regex_scanner.h File 7088 bytes March 31 2025 10:36:16.
regex_scanner.tcc File 15009 bytes March 31 2025 10:36:16.
shared_ptr.h File 23433 bytes March 31 2025 10:36:16.
shared_ptr_atomic.h File 9769 bytes March 31 2025 10:36:16.
shared_ptr_base.h File 54286 bytes March 31 2025 10:36:16.
slice_array.h File 9348 bytes March 31 2025 10:36:16.
specfun.h File 47051 bytes March 31 2025 10:36:16.
sstream.tcc File 10142 bytes March 31 2025 10:36:16.
std_abs.h File 3266 bytes March 31 2025 10:36:16.
std_function.h File 23260 bytes March 31 2025 10:36:16.
std_mutex.h File 9298 bytes March 31 2025 10:36:16.
stl_algo.h File 214294 bytes March 31 2025 10:36:16.
stl_algobase.h File 50494 bytes March 31 2025 10:36:16.
stl_bvector.h File 33728 bytes March 31 2025 10:36:16.
stl_construct.h File 7397 bytes March 31 2025 10:36:16.
stl_deque.h File 78575 bytes March 31 2025 10:36:16.
stl_function.h File 41745 bytes March 31 2025 10:36:16.
stl_heap.h File 20206 bytes March 31 2025 10:36:16.
stl_iterator.h File 42291 bytes March 31 2025 10:36:16.
stl_iterator_base_funcs.h File 8178 bytes March 31 2025 10:36:16.
stl_iterator_base_types.h File 8680 bytes March 31 2025 10:36:16.
stl_list.h File 67558 bytes March 31 2025 10:36:16.
stl_map.h File 52791 bytes March 31 2025 10:36:16.
stl_multimap.h File 41557 bytes March 31 2025 10:36:16.
stl_multiset.h File 35809 bytes March 31 2025 10:36:16.
stl_numeric.h File 13832 bytes March 31 2025 10:36:16.
stl_pair.h File 18642 bytes March 31 2025 10:36:16.
stl_queue.h File 24073 bytes March 31 2025 10:36:16.
stl_raw_storage_iter.h File 3830 bytes March 31 2025 10:36:16.
stl_relops.h File 4594 bytes March 31 2025 10:36:16.
stl_set.h File 36125 bytes March 31 2025 10:36:16.
stl_stack.h File 11938 bytes March 31 2025 10:36:16.
stl_tempbuf.h File 8344 bytes March 31 2025 10:36:16.
stl_tree.h File 74904 bytes March 31 2025 10:36:16.
stl_uninitialized.h File 27709 bytes March 31 2025 10:36:16.
stl_vector.h File 60534 bytes March 31 2025 10:36:16.
stream_iterator.h File 6654 bytes March 31 2025 10:36:16.
streambuf.tcc File 4929 bytes March 31 2025 10:36:16.
streambuf_iterator.h File 13758 bytes March 31 2025 10:36:16.
string_view.tcc File 6698 bytes March 31 2025 10:36:16.
stringfwd.h File 2607 bytes March 31 2025 10:36:16.
uniform_int_dist.h File 10081 bytes March 31 2025 10:36:16.
unique_ptr.h File 25984 bytes March 31 2025 10:36:16.
unordered_map.h File 75341 bytes March 31 2025 10:36:16.
unordered_set.h File 59148 bytes March 31 2025 10:36:16.
uses_allocator.h File 6525 bytes March 31 2025 10:36:16.
valarray_after.h File 22655 bytes March 31 2025 10:36:16.
valarray_array.h File 21807 bytes March 31 2025 10:36:16.
valarray_array.tcc File 7254 bytes March 31 2025 10:36:16.
valarray_before.h File 18513 bytes March 31 2025 10:36:16.
vector.tcc File 29644 bytes March 31 2025 10:36:16.

Reading File: //usr/include/c++//8/bits/regex_compiler.h

// class template regex -*- C++ -*-

// Copyright (C) 2010-2018 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
// <http://www.gnu.org/licenses/>.

/**
 *  @file bits/regex_compiler.h
 *  This is an internal header file, included by other library headers.
 *  Do not attempt to use it directly. @headername{regex}
 */

namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CXX11

  template<typename>
    class regex_traits;

_GLIBCXX_END_NAMESPACE_CXX11

namespace __detail
{
  /**
   * @addtogroup regex-detail
   * @{
   */

  template<typename, bool, bool>
    struct _BracketMatcher;

  /**
   * @brief Builds an NFA from an input iterator range.
   *
   * The %_TraitsT type should fulfill requirements [28.3].
   */
  template<typename _TraitsT>
    class _Compiler
    {
    public:
      typedef typename _TraitsT::char_type        _CharT;
      typedef const _CharT*                       _IterT;
      typedef _NFA<_TraitsT>              	  _RegexT;
      typedef regex_constants::syntax_option_type _FlagT;

      _Compiler(_IterT __b, _IterT __e,
		const typename _TraitsT::locale_type& __traits, _FlagT __flags);

      shared_ptr<const _RegexT>
      _M_get_nfa()
      { return std::move(_M_nfa); }

    private:
      typedef _Scanner<_CharT>               _ScannerT;
      typedef typename _TraitsT::string_type _StringT;
      typedef typename _ScannerT::_TokenT    _TokenT;
      typedef _StateSeq<_TraitsT>            _StateSeqT;
      typedef std::stack<_StateSeqT>         _StackT;
      typedef std::ctype<_CharT>             _CtypeT;

      // accepts a specific token or returns false.
      bool
      _M_match_token(_TokenT __token);

      void
      _M_disjunction();

      void
      _M_alternative();

      bool
      _M_term();

      bool
      _M_assertion();

      bool
      _M_quantifier();

      bool
      _M_atom();

      bool
      _M_bracket_expression();

      template<bool __icase, bool __collate>
	void
	_M_insert_any_matcher_ecma();

      template<bool __icase, bool __collate>
	void
	_M_insert_any_matcher_posix();

      template<bool __icase, bool __collate>
	void
	_M_insert_char_matcher();

      template<bool __icase, bool __collate>
	void
	_M_insert_character_class_matcher();

      template<bool __icase, bool __collate>
	void
	_M_insert_bracket_matcher(bool __neg);

      // Cache of the last atom seen in a bracketed range expression.
      struct _BracketState
      {
	enum class _Type : char { _None, _Char, _Class } _M_type = _Type::_None;
	_CharT _M_char;

	void
	set(_CharT __c) noexcept { _M_type = _Type::_Char; _M_char = __c; }

	_GLIBCXX_NODISCARD _CharT
	get() const noexcept { return _M_char; }

	void
	reset(_Type __t = _Type::_None) noexcept { _M_type = __t; }

	explicit operator bool() const noexcept
	{ return _M_type != _Type::_None; }

	// Previous token was a single character.
	_GLIBCXX_NODISCARD bool
	_M_is_char() const noexcept { return _M_type == _Type::_Char; }

	// Previous token was a character class, equivalent class,
	// collating symbol etc.
	_GLIBCXX_NODISCARD bool
	_M_is_class() const noexcept { return _M_type == _Type::_Class; }
      };

      template<bool __icase, bool __collate>
	using _BracketMatcher
	  = std::__detail::_BracketMatcher<_TraitsT, __icase, __collate>;

      // Returns true if successfully parsed one term and should continue
      // compiling a bracket expression.
      // Returns false if the compiler should move on.
      template<bool __icase, bool __collate>
	bool
	_M_expression_term(_BracketState& __last_char,
			   _BracketMatcher<__icase, __collate>& __matcher);

      int
      _M_cur_int_value(int __radix);

      bool
      _M_try_char();

      _StateSeqT
      _M_pop()
      {
	auto ret = _M_stack.top();
	_M_stack.pop();
	return ret;
      }

      _FlagT              _M_flags;
      _ScannerT           _M_scanner;
      shared_ptr<_RegexT> _M_nfa;
      _StringT            _M_value;
      _StackT             _M_stack;
      const _TraitsT&     _M_traits;
      const _CtypeT&      _M_ctype;
    };

  template<typename _Tp>
    struct __has_contiguous_iter : std::false_type { };

  template<typename _Ch, typename _Tr, typename _Alloc>
    struct __has_contiguous_iter<std::basic_string<_Ch, _Tr, _Alloc>>
    : std::true_type
    { };

  template<typename _Tp, typename _Alloc>
    struct __has_contiguous_iter<std::vector<_Tp, _Alloc>>
    : std::true_type
    { };

  template<typename _Tp>
    struct __is_contiguous_normal_iter : std::false_type { };

  template<typename _CharT>
    struct __is_contiguous_normal_iter<_CharT*> : std::true_type { };

  template<typename _Tp, typename _Cont>
    struct
    __is_contiguous_normal_iter<__gnu_cxx::__normal_iterator<_Tp, _Cont>>
    : __has_contiguous_iter<_Cont>::type
    { };

  template<typename _Iter, typename _TraitsT>
    using __enable_if_contiguous_normal_iter
      = typename enable_if< __is_contiguous_normal_iter<_Iter>::value,
                           std::shared_ptr<const _NFA<_TraitsT>> >::type;

  template<typename _Iter, typename _TraitsT>
    using __disable_if_contiguous_normal_iter
      = typename enable_if< !__is_contiguous_normal_iter<_Iter>::value,
                           std::shared_ptr<const _NFA<_TraitsT>> >::type;

  template<typename _TraitsT, typename _FwdIter>
    inline __enable_if_contiguous_normal_iter<_FwdIter, _TraitsT>
    __compile_nfa(_FwdIter __first, _FwdIter __last,
		  const typename _TraitsT::locale_type& __loc,
		  regex_constants::syntax_option_type __flags)
    {
      size_t __len = __last - __first;
      const auto* __cfirst = __len ? std::__addressof(*__first) : nullptr;
      using _Cmplr = _Compiler<_TraitsT>;
      return _Cmplr(__cfirst, __cfirst + __len, __loc, __flags)._M_get_nfa();
    }

  template<typename _TraitsT, typename _FwdIter>
    inline __disable_if_contiguous_normal_iter<_FwdIter, _TraitsT>
    __compile_nfa(_FwdIter __first, _FwdIter __last,
		  const typename _TraitsT::locale_type& __loc,
		  regex_constants::syntax_option_type __flags)
    {
      const basic_string<typename _TraitsT::char_type> __str(__first, __last);
      return __compile_nfa<_TraitsT>(__str.data(), __str.data() + __str.size(),
				     __loc, __flags);
    }

  // [28.13.14]
  template<typename _TraitsT, bool __icase, bool __collate>
    class _RegexTranslatorBase
    {
    public:
      typedef typename _TraitsT::char_type	      _CharT;
      typedef typename _TraitsT::string_type	      _StringT;
      typedef _StringT _StrTransT;

      explicit
      _RegexTranslatorBase(const _TraitsT& __traits)
      : _M_traits(__traits)
      { }

      _CharT
      _M_translate(_CharT __ch) const
      {
	if (__icase)
	  return _M_traits.translate_nocase(__ch);
	else if (__collate)
	  return _M_traits.translate(__ch);
	else
	  return __ch;
      }

      _StrTransT
      _M_transform(_CharT __ch) const
      {
	_StrTransT __str(1, __ch);
	return _M_traits.transform(__str.begin(), __str.end());
      }

      // See LWG 523. It's not efficiently implementable when _TraitsT is not
      // std::regex_traits<>, and __collate is true. See specializations for
      // implementations of other cases.
      bool
      _M_match_range(const _StrTransT& __first, const _StrTransT& __last,
		     const _StrTransT& __s) const
      { return __first <= __s && __s <= __last; }

    protected:
      bool _M_in_range_icase(_CharT __first, _CharT __last, _CharT __ch) const
      {
	typedef std::ctype<_CharT> __ctype_type;
	const auto& __fctyp = use_facet<__ctype_type>(this->_M_traits.getloc());
	auto __lower = __fctyp.tolower(__ch);
	auto __upper = __fctyp.toupper(__ch);
	return (__first <= __lower && __lower <= __last)
	  || (__first <= __upper && __upper <= __last);
      }

      const _TraitsT& _M_traits;
    };

  template<typename _TraitsT, bool __icase, bool __collate>
    class _RegexTranslator
    : public _RegexTranslatorBase<_TraitsT, __icase, __collate>
    {
    public:
      typedef _RegexTranslatorBase<_TraitsT, __icase, __collate> _Base;
      using _Base::_Base;
    };

  template<typename _TraitsT, bool __icase>
    class _RegexTranslator<_TraitsT, __icase, false>
    : public _RegexTranslatorBase<_TraitsT, __icase, false>
    {
    public:
      typedef _RegexTranslatorBase<_TraitsT, __icase, false> _Base;
      typedef typename _Base::_CharT _CharT;
      typedef _CharT _StrTransT;

      using _Base::_Base;

      _StrTransT
      _M_transform(_CharT __ch) const
      { return __ch; }

      bool
      _M_match_range(_CharT __first, _CharT __last, _CharT __ch) const
      {
	if (!__icase)
	  return __first <= __ch && __ch <= __last;
	return this->_M_in_range_icase(__first, __last, __ch);
      }
    };

  template<typename _CharType>
    class _RegexTranslator<std::regex_traits<_CharType>, true, true>
    : public _RegexTranslatorBase<std::regex_traits<_CharType>, true, true>
    {
    public:
      typedef _RegexTranslatorBase<std::regex_traits<_CharType>, true, true>
	_Base;
      typedef typename _Base::_CharT _CharT;
      typedef typename _Base::_StrTransT _StrTransT;

      using _Base::_Base;

      bool
      _M_match_range(const _StrTransT& __first, const _StrTransT& __last,
		     const _StrTransT& __str) const
      {
	__glibcxx_assert(__first.size() == 1);
	__glibcxx_assert(__last.size() == 1);
	__glibcxx_assert(__str.size() == 1);
	return this->_M_in_range_icase(__first[0], __last[0], __str[0]);
      }
    };

  template<typename _TraitsT>
    class _RegexTranslator<_TraitsT, false, false>
    {
    public:
      typedef typename _TraitsT::char_type _CharT;
      typedef _CharT                       _StrTransT;

      explicit
      _RegexTranslator(const _TraitsT&)
      { }

      _CharT
      _M_translate(_CharT __ch) const
      { return __ch; }

      _StrTransT
      _M_transform(_CharT __ch) const
      { return __ch; }

      bool
      _M_match_range(_CharT __first, _CharT __last, _CharT __ch) const
      { return __first <= __ch && __ch <= __last; }
    };

  template<typename _TraitsT, bool __is_ecma, bool __icase, bool __collate>
    struct _AnyMatcher;

  template<typename _TraitsT, bool __icase, bool __collate>
    struct _AnyMatcher<_TraitsT, false, __icase, __collate>
    {
      typedef _RegexTranslator<_TraitsT, __icase, __collate> _TransT;
      typedef typename _TransT::_CharT                       _CharT;

      explicit
      _AnyMatcher(const _TraitsT& __traits)
      : _M_translator(__traits)
      { }

      bool
      operator()(_CharT __ch) const
      {
	static auto __nul = _M_translator._M_translate('\0');
	return _M_translator._M_translate(__ch) != __nul;
      }

      _TransT _M_translator;
    };

  template<typename _TraitsT, bool __icase, bool __collate>
    struct _AnyMatcher<_TraitsT, true, __icase, __collate>
    {
      typedef _RegexTranslator<_TraitsT, __icase, __collate> _TransT;
      typedef typename _TransT::_CharT                       _CharT;

      explicit
      _AnyMatcher(const _TraitsT& __traits)
      : _M_translator(__traits)
      { }

      bool
      operator()(_CharT __ch) const
      { return _M_apply(__ch, typename is_same<_CharT, char>::type()); }

      bool
      _M_apply(_CharT __ch, true_type) const
      {
	auto __c = _M_translator._M_translate(__ch);
	auto __n = _M_translator._M_translate('\n');
	auto __r = _M_translator._M_translate('\r');
	return __c != __n && __c != __r;
      }

      bool
      _M_apply(_CharT __ch, false_type) const
      {
	auto __c = _M_translator._M_translate(__ch);
	auto __n = _M_translator._M_translate('\n');
	auto __r = _M_translator._M_translate('\r');
	auto __u2028 = _M_translator._M_translate(u'\u2028');
	auto __u2029 = _M_translator._M_translate(u'\u2029');
	return __c != __n && __c != __r && __c != __u2028 && __c != __u2029;
      }

      _TransT _M_translator;
    };

  template<typename _TraitsT, bool __icase, bool __collate>
    struct _CharMatcher
    {
      typedef _RegexTranslator<_TraitsT, __icase, __collate> _TransT;
      typedef typename _TransT::_CharT                       _CharT;

      _CharMatcher(_CharT __ch, const _TraitsT& __traits)
      : _M_translator(__traits), _M_ch(_M_translator._M_translate(__ch))
      { }

      bool
      operator()(_CharT __ch) const
      { return _M_ch == _M_translator._M_translate(__ch); }

      _TransT _M_translator;
      _CharT  _M_ch;
    };

  /// Matches a character range (bracket expression)
  template<typename _TraitsT, bool __icase, bool __collate>
    struct _BracketMatcher
    {
    public:
      typedef _RegexTranslator<_TraitsT, __icase, __collate> _TransT;
      typedef typename _TransT::_CharT                       _CharT;
      typedef typename _TransT::_StrTransT                   _StrTransT;
      typedef typename _TraitsT::string_type                 _StringT;
      typedef typename _TraitsT::char_class_type             _CharClassT;

    public:
      _BracketMatcher(bool __is_non_matching,
		      const _TraitsT& __traits)
      : _M_class_set(0), _M_translator(__traits), _M_traits(__traits),
      _M_is_non_matching(__is_non_matching)
      { }

      bool
      operator()(_CharT __ch) const
      {
	_GLIBCXX_DEBUG_ASSERT(_M_is_ready);
	return _M_apply(__ch, _UseCache());
      }

      void
      _M_add_char(_CharT __c)
      {
	_M_char_set.push_back(_M_translator._M_translate(__c));
	_GLIBCXX_DEBUG_ONLY(_M_is_ready = false);
      }

      _StringT
      _M_add_collate_element(const _StringT& __s)
      {
	auto __st = _M_traits.lookup_collatename(__s.data(),
						 __s.data() + __s.size());
	if (__st.empty())
	  __throw_regex_error(regex_constants::error_collate,
			      "Invalid collate element.");
	_M_char_set.push_back(_M_translator._M_translate(__st[0]));
	_GLIBCXX_DEBUG_ONLY(_M_is_ready = false);
	return __st;
      }

      void
      _M_add_equivalence_class(const _StringT& __s)
      {
	auto __st = _M_traits.lookup_collatename(__s.data(),
						 __s.data() + __s.size());
	if (__st.empty())
	  __throw_regex_error(regex_constants::error_collate,
			      "Invalid equivalence class.");
	__st = _M_traits.transform_primary(__st.data(),
					   __st.data() + __st.size());
	_M_equiv_set.push_back(__st);
	_GLIBCXX_DEBUG_ONLY(_M_is_ready = false);
      }

      // __neg should be true for \D, \S and \W only.
      void
      _M_add_character_class(const _StringT& __s, bool __neg)
      {
	auto __mask = _M_traits.lookup_classname(__s.data(),
						 __s.data() + __s.size(),
						 __icase);
	if (__mask == 0)
	  __throw_regex_error(regex_constants::error_collate,
			      "Invalid character class.");
	if (!__neg)
	  _M_class_set |= __mask;
	else
	  _M_neg_class_set.push_back(__mask);
	_GLIBCXX_DEBUG_ONLY(_M_is_ready = false);
      }

      void
      _M_make_range(_CharT __l, _CharT __r)
      {
	if (__l > __r)
	  __throw_regex_error(regex_constants::error_range,
			      "Invalid range in bracket expression.");
	_M_range_set.push_back(make_pair(_M_translator._M_transform(__l),
					 _M_translator._M_transform(__r)));
	_GLIBCXX_DEBUG_ONLY(_M_is_ready = false);
      }

      void
      _M_ready()
      {
	std::sort(_M_char_set.begin(), _M_char_set.end());
	auto __end = std::unique(_M_char_set.begin(), _M_char_set.end());
	_M_char_set.erase(__end, _M_char_set.end());
	_M_make_cache(_UseCache());
	_GLIBCXX_DEBUG_ONLY(_M_is_ready = true);
      }

    private:
      // Currently we only use the cache for char
      typedef typename std::is_same<_CharT, char>::type _UseCache;

      static constexpr size_t
      _S_cache_size()
      {
	return 1ul << (sizeof(_CharT) * __CHAR_BIT__ * int(_UseCache::value));
      }

      struct _Dummy { };
      typedef typename std::conditional<_UseCache::value,
					std::bitset<_S_cache_size()>,
					_Dummy>::type _CacheT;
      typedef typename std::make_unsigned<_CharT>::type _UnsignedCharT;

      bool
      _M_apply(_CharT __ch, false_type) const;

      bool
      _M_apply(_CharT __ch, true_type) const
      { return _M_cache[static_cast<_UnsignedCharT>(__ch)]; }

      void
      _M_make_cache(true_type)
      {
	for (unsigned __i = 0; __i < _M_cache.size(); __i++)
	  _M_cache[__i] = _M_apply(static_cast<_CharT>(__i), false_type());
      }

      void
      _M_make_cache(false_type)
      { }

    private:
      std::vector<_CharT>                       _M_char_set;
      std::vector<_StringT>                     _M_equiv_set;
      std::vector<pair<_StrTransT, _StrTransT>> _M_range_set;
      std::vector<_CharClassT>                  _M_neg_class_set;
      _CharClassT                               _M_class_set;
      _TransT                                   _M_translator;
      const _TraitsT&                           _M_traits;
      bool                                      _M_is_non_matching;
      _CacheT					_M_cache;
#ifdef _GLIBCXX_DEBUG
      bool                                      _M_is_ready = false;
#endif
    };

 //@} regex-detail
} // namespace __detail
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std

#include <bits/regex_compiler.tcc>

SILENT KILLER Tool