diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-11-24 20:33:19 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-11-24 20:35:17 (GMT) |
commit | 332d60c56dfaa11fdd135088279d15cd5983b3d4 (patch) | |
tree | dd77717a4e1732da929d5ff8a0471fa3f005e201 /3rdParty/Boost/src/boost/regex/v4/regex_format.hpp | |
parent | 90c44a10fec26d2a0935b2d62e82b6a5be028373 (diff) | |
download | swift-332d60c56dfaa11fdd135088279d15cd5983b3d4.zip swift-332d60c56dfaa11fdd135088279d15cd5983b3d4.tar.bz2 |
Upgraded Boost to 1.45.0.
Diffstat (limited to '3rdParty/Boost/src/boost/regex/v4/regex_format.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/regex/v4/regex_format.hpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/3rdParty/Boost/src/boost/regex/v4/regex_format.hpp b/3rdParty/Boost/src/boost/regex/v4/regex_format.hpp index 0ca9baa..4406839 100644 --- a/3rdParty/Boost/src/boost/regex/v4/regex_format.hpp +++ b/3rdParty/Boost/src/boost/regex/v4/regex_format.hpp @@ -34,6 +34,7 @@ #ifndef BOOST_NO_SFINAE #include <boost/mpl/has_xxx.hpp> #endif +#include <boost/ref.hpp> namespace boost{ @@ -152,6 +153,11 @@ private: typedef typename boost::is_convertible<ForwardIter, const char_type*>::type tag_type; return get_named_sub_index(i, j, tag_type()); } +#ifdef BOOST_MSVC + // msvc-8.0 issues a spurious warning on the call to std::advance here: +#pragma warning(push) +#pragma warning(disable:4244) +#endif inline int toi(ForwardIter& i, ForwardIter j, int base, const boost::mpl::false_&) { if(i != j) @@ -165,6 +171,9 @@ private: } return -1; } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif inline int toi(ForwardIter& i, ForwardIter j, int base, const boost::mpl::true_&) { return m_traits.toi(i, j, base); @@ -334,7 +343,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format m_position = --base; } } - put((this->m_results)[this->m_results.size() > 1 ? this->m_results.size() - 1 : 1]); + put((this->m_results)[this->m_results.size() > 1 ? static_cast<int>(this->m_results.size() - 1) : 1]); break; case '{': have_brace = true; @@ -384,7 +393,7 @@ bool basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::handle if(have_brace && (*m_position == '^')) ++m_position; - int max_len = m_end - m_position; + std::ptrdiff_t max_len = m_end - m_position; if((max_len >= 5) && std::equal(m_position, m_position + 5, MATCH)) { @@ -447,7 +456,7 @@ bool basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::handle return false; } } - put((this->m_results)[this->m_results.size() > 1 ? this->m_results.size() - 1 : 1]); + put((this->m_results)[this->m_results.size() > 1 ? static_cast<int>(this->m_results.size() - 1) : 1]); return true; } if((max_len >= 20) && std::equal(m_position, m_position + 20, LAST_SUBMATCH_RESULT)) @@ -895,7 +904,7 @@ private: // F must be a pointer, a function, or a class with a function call operator: // BOOST_STATIC_ASSERT((::boost::is_pointer<F>::value || ::boost::is_function<F>::value || ::boost::is_class<F>::value)); - static formatter_wrapper<F> f; + static formatter_wrapper<typename unwrap_reference<F>::type> f; static M m; static O out; static boost::regex_constants::match_flag_type flags; @@ -963,7 +972,7 @@ struct format_functor3 template <class OutputIter> OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f) { - return func(m, i, f); + return boost::unwrap_ref(func)(m, i, f); } template <class OutputIter, class Traits> OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits&) @@ -983,7 +992,7 @@ struct format_functor2 template <class OutputIter> OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type /*f*/) { - return func(m, i); + return boost::unwrap_ref(func)(m, i); } template <class OutputIter, class Traits> OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits&) @@ -1020,7 +1029,7 @@ struct format_functor1 template <class OutputIter> OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type /*f*/) { - return do_format_string(func(m), i); + return do_format_string(boost::unwrap_ref(func)(m), i); } template <class OutputIter, class Traits> OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits&) |