From 09bfc7f85328adf38ef355621a3ad11e25dfccc7 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 21 Oct 2002 11:03:05 +0000 Subject: [PATCH] Merged changes from the RC_1_29_0 branch. [SVN r15959] --- include/boost/regex/detail/instances.hpp | 2 +- include/boost/regex/detail/regex_match.hpp | 17 +++++++++++------ include/boost/regex/pattern_except.hpp | 7 +++++++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/include/boost/regex/detail/instances.hpp b/include/boost/regex/detail/instances.hpp index 5d30f1ab..a99a2977 100644 --- a/include/boost/regex/detail/instances.hpp +++ b/include/boost/regex/detail/instances.hpp @@ -68,7 +68,7 @@ template class BOOST_REGEX_DECL match_results; +//template class BOOST_REGEX_DECL regex_traits< BOOST_REGEX_CHAR_T >; template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >; template class BOOST_REGEX_DECL re_detail::match_results_base::type)>; template class BOOST_REGEX_DECL re_detail::match_results_base::const_iterator, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits::const_iterator>::type)>; diff --git a/include/boost/regex/detail/regex_match.hpp b/include/boost/regex/detail/regex_match.hpp index e20ebd6d..fa819ef8 100644 --- a/include/boost/regex/detail/regex_match.hpp +++ b/include/boost/regex/detail/regex_match.hpp @@ -195,7 +195,7 @@ public: difference_type max_state_count; iterator* loop_starts; - _priv_match_data(const match_results_base&, iterator, iterator, unsigned); + _priv_match_data(const match_results_base&, iterator, iterator, std::size_t); ~_priv_match_data() { @@ -211,7 +211,7 @@ public: { return loop_starts; } - void estimate_max_state_count(iterator a, iterator b, unsigned states, std::random_access_iterator_tag*) + void estimate_max_state_count(iterator a, iterator b, std::size_t states, std::random_access_iterator_tag*) { difference_type dist = std::distance(a,b); states *= states; @@ -221,7 +221,7 @@ public: else max_state_count = 1000 + states * dist; } - void estimate_max_state_count(iterator a, iterator b, unsigned states, void*) + void estimate_max_state_count(iterator a, iterator b, std::size_t states, void*) { // we don't know how long the sequence is: max_state_count = BOOST_REGEX_MAX_STATE_COUNT; @@ -229,14 +229,16 @@ public: }; template -_priv_match_data::_priv_match_data(const match_results_base& m, iterator a, iterator b, unsigned states) +_priv_match_data::_priv_match_data(const match_results_base& m, iterator a, iterator b, std::size_t states) : temp_match(m), matches(64, m.allocator()), prev_pos(64, m.allocator()), prev_record(64, m.allocator()) { + typedef typename regex_iterator_traits::iterator_category category; + accumulators = 0; caccumulators = 0; loop_starts = 0; state_count = 0; - estimate_max_state_count(a, b, states, static_cast::iterator_category*>(0)); + estimate_max_state_count(a, b, states, static_cast(0)); } template @@ -1088,8 +1090,8 @@ bool query_match_aux(iterator first, if(match_found || have_partial_match) { - return true; pd.state_count = 0; + return true; } // if we get to here then everything has failed @@ -1978,3 +1980,6 @@ inline unsigned int regex_grep(bool (*foo)(const match_results