{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace __detail
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ template<typename _BiIter, typename _Alloc,
+ typename _CharT, typename _TraitsT,
+ _RegexExecutorPolicy __policy,
+ bool __match_mode>
+ bool
+ __regex_algo_impl(_BiIter __s,
+ _BiIter __e,
+ match_results<_BiIter, _Alloc>& __m,
+ const basic_regex<_CharT, _TraitsT>& __re,
+ regex_constants::match_flag_type __flags);
+
+_GLIBCXX_END_NAMESPACE_VERSION
+}
+
/**
* @addtogroup regex
* @{
_AutomatonPtr;
template<typename _BiIter, typename _Alloc,
- typename _CharT, typename _TraitsT>
+ typename _CharT, typename _TraitsT,
+ __detail::_RegexExecutorPolicy __policy>
friend std::unique_ptr<
__detail::_Executor<_BiIter, _Alloc, _CharT, _TraitsT>>
__detail::__get_executor(_BiIter,
const basic_regex<_CharT, _TraitsT>&,
regex_constants::match_flag_type);
- template<typename _Bp, typename _Ap, typename _Cp, typename _Rp>
+ template<typename _Bp, typename _Ap, typename _Cp, typename _Rp,
+ __detail::_RegexExecutorPolicy, bool>
friend bool
- regex_match(_Bp, _Bp,
- match_results<_Bp, _Ap>&,
- const basic_regex<_Cp, _Rp>&,
- regex_constants::match_flag_type);
-
- template<typename _Bp, typename _Ap, typename _Cp, typename _Rp>
- friend bool
- regex_search(_Bp, _Bp,
- match_results<_Bp, _Ap>&,
- const basic_regex<_Cp, _Rp>&,
- regex_constants::match_flag_type);
+ __detail::__regex_algo_impl(_Bp, _Bp, match_results<_Bp, _Ap>&,
+ const basic_regex<_Cp, _Rp>&,
+ regex_constants::match_flag_type);
template<typename, typename, typename, typename>
friend class __detail::_Executor;
template<typename, typename, typename>
friend class regex_iterator;
- template<typename _Bp, typename _Ap,
- typename _Ch_type, typename _Rx_traits>
- friend bool
- regex_match(_Bp, _Bp, match_results<_Bp, _Ap>&,
- const basic_regex<_Ch_type,
- _Rx_traits>&,
- regex_constants::match_flag_type);
-
- template<typename _Bp, typename _Ap,
- typename _Ch_type, typename _Rx_traits>
+ template<typename _Bp, typename _Ap, typename _Cp, typename _Rp,
+ __detail::_RegexExecutorPolicy, bool>
friend bool
- regex_search(_Bp, _Bp, match_results<_Bp, _Ap>&,
- const basic_regex<_Ch_type,
- _Rx_traits>&,
- regex_constants::match_flag_type);
+ __detail::__regex_algo_impl(_Bp, _Bp, match_results<_Bp, _Ap>&,
+ const basic_regex<_Cp, _Rp>&,
+ regex_constants::match_flag_type);
_Bi_iter _M_begin;
bool _M_in_iterator;
*/
template<typename _Bi_iter, typename _Alloc,
typename _Ch_type, typename _Rx_traits>
- bool
+ inline bool
regex_match(_Bi_iter __s,
_Bi_iter __e,
match_results<_Bi_iter, _Alloc>& __m,
const basic_regex<_Ch_type, _Rx_traits>& __re,
regex_constants::match_flag_type __flags
- = regex_constants::match_default);
+ = regex_constants::match_default)
+ {
+ return __detail::__regex_algo_impl<_Bi_iter, _Alloc, _Ch_type, _Rx_traits,
+ __detail::_RegexExecutorPolicy::_S_auto, true>
+ (__s, __e, __m, __re, __flags);
+ }
/**
* @brief Indicates if there is a match between the regular expression @p e
*/
template<typename _Bi_iter, typename _Alloc,
typename _Ch_type, typename _Rx_traits>
- bool
- regex_search(_Bi_iter __first, _Bi_iter __last,
+ inline bool
+ regex_search(_Bi_iter __s, _Bi_iter __e,
match_results<_Bi_iter, _Alloc>& __m,
const basic_regex<_Ch_type, _Rx_traits>& __re,
regex_constants::match_flag_type __flags
- = regex_constants::match_default);
+ = regex_constants::match_default)
+ {
+ return __detail::__regex_algo_impl<_Bi_iter, _Alloc, _Ch_type, _Rx_traits,
+ __detail::_RegexExecutorPolicy::_S_auto, false>
+ (__s, __e, __m, __re, __flags);
+ }
/**
* Searches for a regular expression within a range.
* iterator of the same type.
*/
regex_token_iterator()
- : _M_position(), _M_result(nullptr), _M_suffix(), _M_n(0), _M_subs()
+ : _M_position(), _M_subs(), _M_suffix(), _M_n(0), _M_result(nullptr),
+ _M_has_m1(false)
{ }
/**
* @param __rhs [IN] A %regex_token_iterator to copy.
*/
regex_token_iterator(const regex_token_iterator& __rhs)
- : _M_position(__rhs.position), _M_subs(__rhs.subs), _M_n(__rhs.N),
- _M_result(__rhs.result), _M_suffix(__rhs.suffix),
+ : _M_position(__rhs._M_position), _M_subs(__rhs._M_subs),
+ _M_suffix(__rhs._M_suffix), _M_n(__rhs._M_n), _M_result(__rhs._M_result),
_M_has_m1(__rhs._M_has_m1)
{
if (__rhs._M_result == &__rhs._M_suffix)
{ return _M_result == nullptr; }
_Position _M_position;
- const value_type* _M_result;
+ std::vector<int> _M_subs;
value_type _M_suffix;
std::size_t _M_n;
- std::vector<int> _M_subs;
+ const value_type* _M_result;
// Show whether _M_subs contains -1
bool _M_has_m1;