|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51221 - trunk/boost/regex/v4
From: john_at_[hidden]
Date: 2009-02-12 13:11:44
Author: johnmaddock
Date: 2009-02-12 13:11:43 EST (Thu, 12 Feb 2009)
New Revision: 51221
URL: http://svn.boost.org/trac/boost/changeset/51221
Log:
Workarounds to allow compilation by Sun studio without the -library=stlport4 option.
Text files modified:
trunk/boost/regex/v4/basic_regex_parser.hpp | 10 ++++++++++
trunk/boost/regex/v4/iterator_category.hpp | 4 ++++
2 files changed, 14 insertions(+), 0 deletions(-)
Modified: trunk/boost/regex/v4/basic_regex_parser.hpp
==============================================================================
--- trunk/boost/regex/v4/basic_regex_parser.hpp (original)
+++ trunk/boost/regex/v4/basic_regex_parser.hpp 2009-02-12 13:11:43 EST (Thu, 12 Feb 2009)
@@ -375,8 +375,13 @@
if(0 == (this->flags() & regbase::nosubs))
{
markid = ++m_mark_count;
+#ifndef BOOST_NO_STD_DISTANCE
if(this->flags() & regbase::save_subexpression_location)
this->m_pdata->m_subs.push_back(std::pair<std::size_t, std::size_t>(std::distance(m_base, m_position) - 1, 0));
+#else
+ if(this->flags() & regbase::save_subexpression_location)
+ this->m_pdata->m_subs.push_back(std::pair<std::size_t, std::size_t>((m_position - m_base) - 1, 0));
+#endif
}
re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_startmark, sizeof(re_brace)));
pb->index = markid;
@@ -424,8 +429,13 @@
return false;
}
BOOST_ASSERT(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_mark);
+#ifndef BOOST_NO_STD_DISTANCE
if(markid && (this->flags() & regbase::save_subexpression_location))
this->m_pdata->m_subs.at(markid - 1).second = std::distance(m_base, m_position);
+#else
+ if(markid && (this->flags() & regbase::save_subexpression_location))
+ this->m_pdata->m_subs.at(markid - 1).second = (m_position - m_base);
+#endif
++m_position;
//
// append closing parenthesis state:
Modified: trunk/boost/regex/v4/iterator_category.hpp
==============================================================================
--- trunk/boost/regex/v4/iterator_category.hpp (original)
+++ trunk/boost/regex/v4/iterator_category.hpp 2009-02-12 13:11:43 EST (Thu, 12 Feb 2009)
@@ -31,10 +31,14 @@
template <class I>
struct is_random_imp
{
+#ifndef BOOST_NO_STD_ITERATOR_TRAITS
private:
typedef typename std::iterator_traits<I>::iterator_category cat;
public:
BOOST_STATIC_CONSTANT(bool, value = (::boost::is_convertible<cat*, std::random_access_iterator_tag*>::value));
+#else
+ BOOST_STATIC_CONSTANT(bool, value = false);
+#endif
};
template <class I>
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk