HP aCC patches.

[SVN r23169]
This commit is contained in:
John Maddock
2004-06-23 12:44:17 +00:00
parent eec095b121
commit 6732abe03e
4 changed files with 14 additions and 6 deletions

View File

@ -252,7 +252,7 @@ public:
std::string What(int i = 0)const;
std::string operator[](int i)const { return What(i); }
static const unsigned int npos;
static const std::size_t npos;
friend struct re_detail::pred1;
friend struct re_detail::pred2;

View File

@ -23,7 +23,8 @@
#include <boost/detail/workaround.hpp>
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
|| BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
|| BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(55500))
//
// Borland C++ Builder 6, and Visual C++ 6,
// can't cope with the array template constructor

View File

@ -379,7 +379,7 @@ int BOOST_REGEX_CALL cpp_regex_traits<char>::toi(char c)const
int BOOST_REGEX_CALL cpp_regex_traits<char>::toi(const char*& first, const char* last, int radix)const
{
pmd->sbuf.pubsetbuf(const_cast<char*>(first), static_cast<std::streamsize>(last-first));
pmd->sbuf.pubsetbuf(const_cast<char*>(static_cast<const char*>(first)), static_cast<std::streamsize>(last-first));
pmd->is.clear();
if(std::abs(radix) == 16) pmd->is >> std::hex;
else if(std::abs(radix) == 8) pmd->is >> std::oct;

View File

@ -21,6 +21,7 @@
#include <boost/cregex.hpp>
#include <boost/regex.hpp>
#include <boost/integer_traits.hpp>
#if !defined(BOOST_NO_STD_STRING)
#include <map>
#include <list>
@ -113,7 +114,7 @@ void RegExData::update()
for(unsigned int i = 0; i < m.size(); ++i)
{
if(m[i].matched) strings[i] = std::string(m[i].first, m[i].second);
positions[i] = m[i].matched ? m[i].first - pbase : -1;
positions[i] = m[i].matched ? m[i].first - pbase : RegEx::npos;
}
}
#ifndef BOOST_REGEX_NO_FILEITER
@ -122,7 +123,7 @@ void RegExData::update()
for(unsigned int i = 0; i < fm.size(); ++i)
{
if(fm[i].matched) strings[i] = to_string(fm[i].first, fm[i].second);
positions[i] = fm[i].matched ? fm[i].first - fbase : -1;
positions[i] = fm[i].matched ? fm[i].first - fbase : RegEx::npos;
}
}
#endif
@ -585,7 +586,13 @@ std::string RegEx::What(int i)const
return result;
}
const unsigned int RegEx::npos = ~0u;
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
const std::size_t RegEx::npos = ::boost::integer_traits<std::size_t>::const_max;
#elif defined(BOOST_HAS_LONG_LONG)
const std::size_t RegEx::npos = ~0ULL;
#else
const std::size_t RegEx::npos = ~0UL;
#endif
} // namespace boost