From a2142edcd3c4335faf02f5ef3c0577d6611cb1ea Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 20 Apr 2010 16:03:14 +0000 Subject: [PATCH] Disambiguate between boost::ref and std:ref etc. Suppress some new warnings from VC-10. Fix singular iterator logic (fixes VC-10 failures). Fixes #4114. Fixes #3632 [SVN r61430] --- include/boost/regex/concepts.hpp | 152 ++++++++++---------- include/boost/regex/v4/cpp_regex_traits.hpp | 2 +- include/boost/regex/v4/match_results.hpp | 2 +- include/boost/regex/v4/regex_format.hpp | 6 +- 4 files changed, 85 insertions(+), 77 deletions(-) diff --git a/include/boost/regex/concepts.hpp b/include/boost/regex/concepts.hpp index 28d5aeb6..016cf0f2 100644 --- a/include/boost/regex/concepts.hpp +++ b/include/boost/regex/concepts.hpp @@ -106,6 +106,14 @@ public: allocator_architype(); allocator_architype(const allocator_architype&); +#if defined(BOOST_MSVC) && (BOOST_MSVC == 1600) + // + // This doesn't appear to be part of the allocator requirements + // in the std, but is required by std::vector in VC10 :-( + // + template + allocator_architype(const allocator_architype&); +#endif void construct(pointer, const_reference); void destroy(pointer); @@ -990,18 +998,18 @@ struct BoostRegexConcept out = regex_format(out, m_cresults, func2b); out = regex_format(out, m_cresults, func1b, f); out = regex_format(out, m_cresults, func1b); - out = regex_format(out, m_cresults, ref(func3b), f); - out = regex_format(out, m_cresults, ref(func3b)); - out = regex_format(out, m_cresults, ref(func2b), f); - out = regex_format(out, m_cresults, ref(func2b)); - out = regex_format(out, m_cresults, ref(func1b), f); - out = regex_format(out, m_cresults, ref(func1b)); - out = regex_format(out, m_cresults, cref(func3b), f); - out = regex_format(out, m_cresults, cref(func3b)); - out = regex_format(out, m_cresults, cref(func2b), f); - out = regex_format(out, m_cresults, cref(func2b)); - out = regex_format(out, m_cresults, cref(func1b), f); - out = regex_format(out, m_cresults, cref(func1b)); + out = regex_format(out, m_cresults, boost::ref(func3b), f); + out = regex_format(out, m_cresults, boost::ref(func3b)); + out = regex_format(out, m_cresults, boost::ref(func2b), f); + out = regex_format(out, m_cresults, boost::ref(func2b)); + out = regex_format(out, m_cresults, boost::ref(func1b), f); + out = regex_format(out, m_cresults, boost::ref(func1b)); + out = regex_format(out, m_cresults, boost::cref(func3b), f); + out = regex_format(out, m_cresults, boost::cref(func3b)); + out = regex_format(out, m_cresults, boost::cref(func2b), f); + out = regex_format(out, m_cresults, boost::cref(func2b)); + out = regex_format(out, m_cresults, boost::cref(func1b), f); + out = regex_format(out, m_cresults, boost::cref(func1b)); m_string += regex_format(m_cresults, func3b, f); m_string += regex_format(m_cresults, func3b); @@ -1009,18 +1017,18 @@ struct BoostRegexConcept m_string += regex_format(m_cresults, func2b); m_string += regex_format(m_cresults, func1b, f); m_string += regex_format(m_cresults, func1b); - m_string += regex_format(m_cresults, ref(func3b), f); - m_string += regex_format(m_cresults, ref(func3b)); - m_string += regex_format(m_cresults, ref(func2b), f); - m_string += regex_format(m_cresults, ref(func2b)); - m_string += regex_format(m_cresults, ref(func1b), f); - m_string += regex_format(m_cresults, ref(func1b)); - m_string += regex_format(m_cresults, cref(func3b), f); - m_string += regex_format(m_cresults, cref(func3b)); - m_string += regex_format(m_cresults, cref(func2b), f); - m_string += regex_format(m_cresults, cref(func2b)); - m_string += regex_format(m_cresults, cref(func1b), f); - m_string += regex_format(m_cresults, cref(func1b)); + m_string += regex_format(m_cresults, boost::ref(func3b), f); + m_string += regex_format(m_cresults, boost::ref(func3b)); + m_string += regex_format(m_cresults, boost::ref(func2b), f); + m_string += regex_format(m_cresults, boost::ref(func2b)); + m_string += regex_format(m_cresults, boost::ref(func1b), f); + m_string += regex_format(m_cresults, boost::ref(func1b)); + m_string += regex_format(m_cresults, boost::cref(func3b), f); + m_string += regex_format(m_cresults, boost::cref(func3b)); + m_string += regex_format(m_cresults, boost::cref(func2b), f); + m_string += regex_format(m_cresults, boost::cref(func2b)); + m_string += regex_format(m_cresults, boost::cref(func1b), f); + m_string += regex_format(m_cresults, boost::cref(func1b)); out = m_cresults.format(out, func3b, f); out = m_cresults.format(out, func3b); @@ -1028,18 +1036,18 @@ struct BoostRegexConcept out = m_cresults.format(out, func2b); out = m_cresults.format(out, func1b, f); out = m_cresults.format(out, func1b); - out = m_cresults.format(out, ref(func3b), f); - out = m_cresults.format(out, ref(func3b)); - out = m_cresults.format(out, ref(func2b), f); - out = m_cresults.format(out, ref(func2b)); - out = m_cresults.format(out, ref(func1b), f); - out = m_cresults.format(out, ref(func1b)); - out = m_cresults.format(out, cref(func3b), f); - out = m_cresults.format(out, cref(func3b)); - out = m_cresults.format(out, cref(func2b), f); - out = m_cresults.format(out, cref(func2b)); - out = m_cresults.format(out, cref(func1b), f); - out = m_cresults.format(out, cref(func1b)); + out = m_cresults.format(out, boost::ref(func3b), f); + out = m_cresults.format(out, boost::ref(func3b)); + out = m_cresults.format(out, boost::ref(func2b), f); + out = m_cresults.format(out, boost::ref(func2b)); + out = m_cresults.format(out, boost::ref(func1b), f); + out = m_cresults.format(out, boost::ref(func1b)); + out = m_cresults.format(out, boost::cref(func3b), f); + out = m_cresults.format(out, boost::cref(func3b)); + out = m_cresults.format(out, boost::cref(func2b), f); + out = m_cresults.format(out, boost::cref(func2b)); + out = m_cresults.format(out, boost::cref(func1b), f); + out = m_cresults.format(out, boost::cref(func1b)); m_string += m_cresults.format(func3b, f); m_string += m_cresults.format(func3b); @@ -1047,18 +1055,18 @@ struct BoostRegexConcept m_string += m_cresults.format(func2b); m_string += m_cresults.format(func1b, f); m_string += m_cresults.format(func1b); - m_string += m_cresults.format(ref(func3b), f); - m_string += m_cresults.format(ref(func3b)); - m_string += m_cresults.format(ref(func2b), f); - m_string += m_cresults.format(ref(func2b)); - m_string += m_cresults.format(ref(func1b), f); - m_string += m_cresults.format(ref(func1b)); - m_string += m_cresults.format(cref(func3b), f); - m_string += m_cresults.format(cref(func3b)); - m_string += m_cresults.format(cref(func2b), f); - m_string += m_cresults.format(cref(func2b)); - m_string += m_cresults.format(cref(func1b), f); - m_string += m_cresults.format(cref(func1b)); + m_string += m_cresults.format(boost::ref(func3b), f); + m_string += m_cresults.format(boost::ref(func3b)); + m_string += m_cresults.format(boost::ref(func2b), f); + m_string += m_cresults.format(boost::ref(func2b)); + m_string += m_cresults.format(boost::ref(func1b), f); + m_string += m_cresults.format(boost::ref(func1b)); + m_string += m_cresults.format(boost::cref(func3b), f); + m_string += m_cresults.format(boost::cref(func3b)); + m_string += m_cresults.format(boost::cref(func2b), f); + m_string += m_cresults.format(boost::cref(func2b)); + m_string += m_cresults.format(boost::cref(func1b), f); + m_string += m_cresults.format(boost::cref(func1b)); out = regex_replace(out, m_in, m_in, ce, func3, f); out = regex_replace(out, m_in, m_in, ce, func3); @@ -1066,18 +1074,18 @@ struct BoostRegexConcept out = regex_replace(out, m_in, m_in, ce, func2); out = regex_replace(out, m_in, m_in, ce, func1, f); out = regex_replace(out, m_in, m_in, ce, func1); - out = regex_replace(out, m_in, m_in, ce, ref(func3), f); - out = regex_replace(out, m_in, m_in, ce, ref(func3)); - out = regex_replace(out, m_in, m_in, ce, ref(func2), f); - out = regex_replace(out, m_in, m_in, ce, ref(func2)); - out = regex_replace(out, m_in, m_in, ce, ref(func1), f); - out = regex_replace(out, m_in, m_in, ce, ref(func1)); - out = regex_replace(out, m_in, m_in, ce, cref(func3), f); - out = regex_replace(out, m_in, m_in, ce, cref(func3)); - out = regex_replace(out, m_in, m_in, ce, cref(func2), f); - out = regex_replace(out, m_in, m_in, ce, cref(func2)); - out = regex_replace(out, m_in, m_in, ce, cref(func1), f); - out = regex_replace(out, m_in, m_in, ce, cref(func1)); + out = regex_replace(out, m_in, m_in, ce, boost::ref(func3), f); + out = regex_replace(out, m_in, m_in, ce, boost::ref(func3)); + out = regex_replace(out, m_in, m_in, ce, boost::ref(func2), f); + out = regex_replace(out, m_in, m_in, ce, boost::ref(func2)); + out = regex_replace(out, m_in, m_in, ce, boost::ref(func1), f); + out = regex_replace(out, m_in, m_in, ce, boost::ref(func1)); + out = regex_replace(out, m_in, m_in, ce, boost::cref(func3), f); + out = regex_replace(out, m_in, m_in, ce, boost::cref(func3)); + out = regex_replace(out, m_in, m_in, ce, boost::cref(func2), f); + out = regex_replace(out, m_in, m_in, ce, boost::cref(func2)); + out = regex_replace(out, m_in, m_in, ce, boost::cref(func1), f); + out = regex_replace(out, m_in, m_in, ce, boost::cref(func1)); functor3 > func3s; functor2 > func2s; @@ -1088,18 +1096,18 @@ struct BoostRegexConcept m_string += regex_replace(m_string, ce, func2s); m_string += regex_replace(m_string, ce, func1s, f); m_string += regex_replace(m_string, ce, func1s); - m_string += regex_replace(m_string, ce, ref(func3s), f); - m_string += regex_replace(m_string, ce, ref(func3s)); - m_string += regex_replace(m_string, ce, ref(func2s), f); - m_string += regex_replace(m_string, ce, ref(func2s)); - m_string += regex_replace(m_string, ce, ref(func1s), f); - m_string += regex_replace(m_string, ce, ref(func1s)); - m_string += regex_replace(m_string, ce, cref(func3s), f); - m_string += regex_replace(m_string, ce, cref(func3s)); - m_string += regex_replace(m_string, ce, cref(func2s), f); - m_string += regex_replace(m_string, ce, cref(func2s)); - m_string += regex_replace(m_string, ce, cref(func1s), f); - m_string += regex_replace(m_string, ce, cref(func1s)); + m_string += regex_replace(m_string, ce, boost::ref(func3s), f); + m_string += regex_replace(m_string, ce, boost::ref(func3s)); + m_string += regex_replace(m_string, ce, boost::ref(func2s), f); + m_string += regex_replace(m_string, ce, boost::ref(func2s)); + m_string += regex_replace(m_string, ce, boost::ref(func1s), f); + m_string += regex_replace(m_string, ce, boost::ref(func1s)); + m_string += regex_replace(m_string, ce, boost::cref(func3s), f); + m_string += regex_replace(m_string, ce, boost::cref(func3s)); + m_string += regex_replace(m_string, ce, boost::cref(func2s), f); + m_string += regex_replace(m_string, ce, boost::cref(func2s)); + m_string += regex_replace(m_string, ce, boost::cref(func1s), f); + m_string += regex_replace(m_string, ce, boost::cref(func1s)); } std::basic_ostream m_stream; diff --git a/include/boost/regex/v4/cpp_regex_traits.hpp b/include/boost/regex/v4/cpp_regex_traits.hpp index bb40aa1e..addc96cd 100644 --- a/include/boost/regex/v4/cpp_regex_traits.hpp +++ b/include/boost/regex/v4/cpp_regex_traits.hpp @@ -56,7 +56,7 @@ #ifdef BOOST_MSVC #pragma warning(push) -#pragma warning(disable:4786) +#pragma warning(disable:4786 4251) #endif namespace boost{ diff --git a/include/boost/regex/v4/match_results.hpp b/include/boost/regex/v4/match_results.hpp index 514dbad7..8f11bbbe 100644 --- a/include/boost/regex/v4/match_results.hpp +++ b/include/boost/regex/v4/match_results.hpp @@ -393,7 +393,6 @@ public: std::swap(m_subs, that.m_subs); std::swap(m_named_subs, that.m_named_subs); std::swap(m_last_closed_paren, that.m_last_closed_paren); - std::swap(m_is_singular, that.m_is_singular); if(m_is_singular) { if(!that.m_is_singular) @@ -412,6 +411,7 @@ public: std::swap(m_base, that.m_base); std::swap(m_null, that.m_null); } + std::swap(m_is_singular, that.m_is_singular); } bool operator==(const match_results& that)const { diff --git a/include/boost/regex/v4/regex_format.hpp b/include/boost/regex/v4/regex_format.hpp index f4d87681..2bd6bac1 100644 --- a/include/boost/regex/v4/regex_format.hpp +++ b/include/boost/regex/v4/regex_format.hpp @@ -964,7 +964,7 @@ struct format_functor3 template OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f) { - return unwrap_ref(func)(m, i, f); + return boost::unwrap_ref(func)(m, i, f); } template OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits&) @@ -984,7 +984,7 @@ struct format_functor2 template OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type /*f*/) { - return unwrap_ref(func)(m, i); + return boost::unwrap_ref(func)(m, i); } template OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits&) @@ -1021,7 +1021,7 @@ struct format_functor1 template OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type /*f*/) { - return do_format_string(unwrap_ref(func)(m), i); + return do_format_string(boost::unwrap_ref(func)(m), i); } template OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits&)