From df6fa4ba7950b5d87554366509d22536428397b5 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 17 Oct 2000 11:28:05 +0000 Subject: [PATCH] regex fixes [SVN r7967] --- include/boost/re_detail/regex_format.hpp | 19 ++++++++++--------- include/boost/re_detail/regex_split.hpp | 6 +++--- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/boost/re_detail/regex_format.hpp b/include/boost/re_detail/regex_format.hpp index 7a3d7cd6..b6fbccd5 100644 --- a/include/boost/re_detail/regex_format.hpp +++ b/include/boost/re_detail/regex_format.hpp @@ -471,7 +471,7 @@ public: } // namespace re_detail template -OutputIterator BOOST_RE_CALL regex_format(OutputIterator out, +OutputIterator regex_format(OutputIterator out, const match_results& m, const charT* fmt, unsigned flags = 0 @@ -482,18 +482,19 @@ OutputIterator BOOST_RE_CALL regex_format(OutputIterator out, } template -OutputIterator BOOST_RE_CALL regex_format(OutputIterator out, +OutputIterator regex_format(OutputIterator out, const match_results& m, const std::basic_string& fmt, unsigned flags = 0 ) { regex_traits t; - return re_detail::_reg_format_aux(out, m, fmt.c_str(), flags, t); + const charT* start = fmt.c_str(); + return re_detail::_reg_format_aux(out, m, start, flags, t); } template -std::basic_string BOOST_RE_CALL regex_format(const match_results& m, const charT* fmt, unsigned flags = 0) +std::basic_string regex_format(const match_results& m, const charT* fmt, unsigned flags = 0) { std::basic_string result; re_detail::string_out_iterator > i(result); @@ -502,7 +503,7 @@ std::basic_string BOOST_RE_CALL regex_format(const match_results -std::basic_string BOOST_RE_CALL regex_format(const match_results& m, const std::basic_string& fmt, unsigned flags = 0) +std::basic_string regex_format(const match_results& m, const std::basic_string& fmt, unsigned flags = 0) { std::basic_string result; re_detail::string_out_iterator > i(result); @@ -511,7 +512,7 @@ std::basic_string BOOST_RE_CALL regex_format(const match_results -OutputIterator BOOST_RE_CALL regex_merge(OutputIterator out, +OutputIterator regex_merge(OutputIterator out, iterator first, iterator last, const reg_expression& e, @@ -525,7 +526,7 @@ OutputIterator BOOST_RE_CALL regex_merge(OutputIterator out, } template -inline OutputIterator BOOST_RE_CALL regex_merge(OutputIterator out, +inline OutputIterator regex_merge(OutputIterator out, iterator first, iterator last, const reg_expression& e, @@ -536,7 +537,7 @@ inline OutputIterator BOOST_RE_CALL regex_merge(OutputIterator out, } template -std::basic_string BOOST_RE_CALL regex_merge(const std::basic_string& s, +std::basic_string regex_merge(const std::basic_string& s, const reg_expression& e, const charT* fmt, unsigned int flags = match_default) @@ -548,7 +549,7 @@ std::basic_string BOOST_RE_CALL regex_merge(const std::basic_string -std::basic_string BOOST_RE_CALL regex_merge(const std::basic_string& s, +std::basic_string regex_merge(const std::basic_string& s, const reg_expression& e, const std::basic_string& fmt, unsigned int flags = match_default) diff --git a/include/boost/re_detail/regex_split.hpp b/include/boost/re_detail/regex_split.hpp index bbce7f08..2273bc08 100644 --- a/include/boost/re_detail/regex_split.hpp +++ b/include/boost/re_detail/regex_split.hpp @@ -71,7 +71,7 @@ bool split_pred::operator() // output sub-expressions only: for(unsigned i = 1; i < what.size(); ++i) { - (*p_out) = static_cast(what[i]); + *(*p_out) = static_cast(what[i]); ++(*p_out); return --*p_max; } @@ -82,7 +82,7 @@ bool split_pred::operator() const sub_match& sub = what[-1]; if((sub.first != sub.second) || (*p_max != initial_max)) { - (*p_out) = static_cast(sub); + *(*p_out) = static_cast(sub); ++(*p_out); return --*p_max; } @@ -115,7 +115,7 @@ std::size_t regex_split(OutputIterator out, // than whitespace: if(max_split && (last != s.end()) && (e.mark_count() == 1)) { - out = std::basic_string((ci_t)last, (ci_t)s.end()); + *out = std::basic_string((ci_t)last, (ci_t)s.end()); ++out; last = s.end(); }