* 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 <jwakely.gcc@gmail.com>
* include/bits/regex_automaton.h (_S_opcode_word_boundry): Rename to
* @{
*/
- template<typename _CharT, typename _TraitsT>
+ template<typename _TraitsT>
struct _BracketMatcher;
/// Builds an NFA from an input iterator interval.
{ 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<typename _TraitsT::char_type> _CtypeT;
// accepts a specific token or returns false.
bool
return _Cmplr(__first, __last, __traits, __flags)._M_get_nfa();
}
- template<typename _CharT, typename _TraitsT>
+ template<typename _TraitsT>
struct _AnyMatcher
{
+ typedef typename _TraitsT::char_type _CharT;
+
explicit
_AnyMatcher(const _TraitsT& __traits)
: _M_traits(__traits)
const _TraitsT& _M_traits;
};
- template<typename _CharT, typename _TraitsT>
+ template<typename _TraitsT>
struct _CharMatcher
{
+ typedef typename _TraitsT::char_type _CharT;
typedef regex_constants::syntax_option_type _FlagT;
explicit
};
/// Matches a character range (bracket expression)
- template<typename _CharT, typename _TraitsT>
+ template<typename _TraitsT>
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;
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))
return __v;
}
- template<typename _CharT, typename _TraitsT>
+ template<typename _TraitsT>
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)