forked from boostorg/regex
Workarounds to allow compilation by Sun studio without the -library=stlport4 option.
[SVN r51221]
This commit is contained in:
@ -375,8 +375,13 @@ bool basic_regex_parser<charT, traits>::parse_open_paren()
|
|||||||
if(0 == (this->flags() & regbase::nosubs))
|
if(0 == (this->flags() & regbase::nosubs))
|
||||||
{
|
{
|
||||||
markid = ++m_mark_count;
|
markid = ++m_mark_count;
|
||||||
|
#ifndef BOOST_NO_STD_DISTANCE
|
||||||
if(this->flags() & regbase::save_subexpression_location)
|
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));
|
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)));
|
re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_startmark, sizeof(re_brace)));
|
||||||
pb->index = markid;
|
pb->index = markid;
|
||||||
@ -424,8 +429,13 @@ bool basic_regex_parser<charT, traits>::parse_open_paren()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
BOOST_ASSERT(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_mark);
|
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))
|
if(markid && (this->flags() & regbase::save_subexpression_location))
|
||||||
this->m_pdata->m_subs.at(markid - 1).second = std::distance(m_base, m_position);
|
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;
|
++m_position;
|
||||||
//
|
//
|
||||||
// append closing parenthesis state:
|
// append closing parenthesis state:
|
||||||
|
@ -31,10 +31,14 @@ namespace detail{
|
|||||||
template <class I>
|
template <class I>
|
||||||
struct is_random_imp
|
struct is_random_imp
|
||||||
{
|
{
|
||||||
|
#ifndef BOOST_NO_STD_ITERATOR_TRAITS
|
||||||
private:
|
private:
|
||||||
typedef typename std::iterator_traits<I>::iterator_category cat;
|
typedef typename std::iterator_traits<I>::iterator_category cat;
|
||||||
public:
|
public:
|
||||||
BOOST_STATIC_CONSTANT(bool, value = (::boost::is_convertible<cat*, std::random_access_iterator_tag*>::value));
|
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>
|
template <class I>
|
||||||
|
Reference in New Issue
Block a user