From bb038ece8f58d223049ffd6f0982352d431b4f29 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 8 Nov 2013 14:30:34 +0000 Subject: [PATCH] regex_compiler.h (__detail::_AnyMatcher, [...]): Remove redundant _CharT template parameters. * include/bits/regex_compiler.h (__detail::_AnyMatcher, __detail::_CharMatcher, __detail::_BracketMatcher): Remove redundant _CharT template parameters. * include/bits/regex_compiler.tcc: Likewise. From-SVN: r204573 --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/include/bits/regex_compiler.h | 17 ++++++++++------- libstdc++-v3/include/bits/regex_compiler.tcc | 8 ++++---- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c8cd185..93203c2 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -23,6 +23,11 @@ * include/bits/regex.h (basic_regex): Assert char_type matches. Use __compile_nfa object generator. Remove _CharT template parameter. + * include/bits/regex_compiler.h (__detail::_AnyMatcher, + __detail::_CharMatcher, __detail::_BracketMatcher): Remove redundant + _CharT template parameters. + * include/bits/regex_compiler.tcc: Likewise. + 2013-11-06 Jonathan Wakely * include/bits/regex_automaton.h (_S_opcode_word_boundry): Rename to diff --git a/libstdc++-v3/include/bits/regex_compiler.h b/libstdc++-v3/include/bits/regex_compiler.h index fef8862..406d9a9 100644 --- a/libstdc++-v3/include/bits/regex_compiler.h +++ b/libstdc++-v3/include/bits/regex_compiler.h @@ -39,7 +39,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @{ */ - template + template struct _BracketMatcher; /// Builds an NFA from an input iterator interval. @@ -59,13 +59,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return make_shared<_RegexT>(std::move(_M_nfa)); } private: - typedef typename _TraitsT::char_type _CharT; typedef _Scanner<_FwdIter> _ScannerT; typedef typename _ScannerT::_TokenT _TokenT; typedef _StateSeq<_TraitsT> _StateSeqT; typedef std::stack<_StateSeqT, std::vector<_StateSeqT>> _StackT; - typedef _BracketMatcher<_CharT, _TraitsT> _BMatcherT; - typedef std::ctype<_CharT> _CtypeT; + typedef _BracketMatcher<_TraitsT> _BMatcherT; + typedef std::ctype _CtypeT; // accepts a specific token or returns false. bool @@ -139,9 +138,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return _Cmplr(__first, __last, __traits, __flags)._M_get_nfa(); } - template + template struct _AnyMatcher { + typedef typename _TraitsT::char_type _CharT; + explicit _AnyMatcher(const _TraitsT& __traits) : _M_traits(__traits) @@ -159,9 +160,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const _TraitsT& _M_traits; }; - template + template struct _CharMatcher { + typedef typename _TraitsT::char_type _CharT; typedef regex_constants::syntax_option_type _FlagT; explicit @@ -188,9 +190,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION }; /// Matches a character range (bracket expression) - template + template struct _BracketMatcher { + typedef typename _TraitsT::char_type _CharT; typedef typename _TraitsT::char_class_type _CharClassT; typedef typename _TraitsT::string_type _StringT; typedef regex_constants::syntax_option_type _FlagT; diff --git a/libstdc++-v3/include/bits/regex_compiler.tcc b/libstdc++-v3/include/bits/regex_compiler.tcc index 49c32b8..f89498f 100644 --- a/libstdc++-v3/include/bits/regex_compiler.tcc +++ b/libstdc++-v3/include/bits/regex_compiler.tcc @@ -286,11 +286,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (_M_match_token(_ScannerT::_S_token_anychar)) _M_stack.push(_StateSeqT(_M_nfa, _M_nfa._M_insert_matcher - (_AnyMatcher<_CharT, _TraitsT>(_M_traits)))); + (_AnyMatcher<_TraitsT>(_M_traits)))); else if (_M_try_char()) _M_stack.push(_StateSeqT(_M_nfa, _M_nfa._M_insert_matcher - (_CharMatcher<_CharT, _TraitsT>(_M_value[0], + (_CharMatcher<_TraitsT>(_M_value[0], _M_traits, _M_flags)))); else if (_M_match_token(_ScannerT::_S_token_backref)) @@ -430,9 +430,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return __v; } - template + template bool - _BracketMatcher<_CharT, _TraitsT>::operator()(_CharT __ch) const + _BracketMatcher<_TraitsT>::operator()(_CharT __ch) const { bool __ret = false; if (_M_traits.isctype(__ch, _M_class_set) -- 2.7.4