Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7606: u32regex causes bus error
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-11-30 16:39:29
#7606: u32regex causes bus error
-----------------------------------------+----------------------------------
Reporter: a.sanders@⦠| Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: regex
Version: Boost 1.51.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------------+----------------------------------
Comment (by anonymous):
You're right, doesn't really help :-(
Try:
{{{
#include <boost/regex/icu.hpp>
template <class C>
void printout(const C& c)
{
for(unsigned i = 0; i < c.size(); ++i)
std::cout << std::hex << (int)c[i] << " ";
std::cout << std::endl;
}
int main()
{
using namespace boost;
typedef u32regex::traits_type::string_type st;
typedef boost::u8_to_u32_iterator<std::string::const_iterator, UChar32>
conv_type;
const std::string p = "[pq]\\.\\.[xy]";
st t(conv_type(p.begin(), p.begin(), p.end()), conv_type(p.end(),
p.begin(), p.end()));
printout(p);
printout(t);
return 0;
}
}}}
Which should output:
{{{
5b 70 71 5d 5c 2e 5c 2e 5b 78 79 5d
5b 70 71 5d 5c 2e 5c 2e 5b 78 79 5d
}}}
Thanks! John.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7606#comment:9> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC