regex_search (extended syntax) can search to the end of the iterator
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
participants (1)
-
David McKelvie