Boost logo

Boost Users :

From: David McKelvie (david_at_[hidden])
Date: 2005-03-23 16:01:59


>> It seems that regex_search iterates to the end of the sequence
>> using ++iterator rather than stopping once it has found the first match

John Maddock replied:

>> 1) reproduce the behaviour with 1.32.
>> 2) Let me have a reproducible test case.
>> 3) Check that it's not a call to std::distance that seeking the iterator to
>> the end (it shouldn't be).

I have now reproduced the behaviour with Boost 1.32.
I include a test case below.
It does seem to be a call to std::distance which is seeking the end.

The problem arises only if boost::regex::extended is specified
at break /usr/local/include/boost-1_32/boost/regex/v4/perl_matcher_common.hpp:418
 m_result.maybe_assign(*m_presult) is being called
which then calls std::distance which does the seek to the end.

The problem is probably in my iterator implementation as this is the
first Ive tried to write, But that seems simple enough, so maybe its
more general.

This is running on Linux Fedora Core 1
Boost 1.32
gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1)

    David




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net