ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] boost::regex opeartor+= bug report
by Dave Gomboc other posts by this author
Jun 25 2003 12:26AM messages near this date
Re: [boost] API Review request: XML API for C++, second round | [boost] Re: boost::regex opeartor+= bug report
The file "boost/regex/v4/perl_matcher_non_recursive.hpp" includes
statements such as

    end += std::min((unsigned)re_detail::distance(position, last),
desired);

operator+= is appropriate for random-access iterators, but not for
merely bidirectional iterators such as std::list<char> ::iterator, which
is what I was using when I came across the problem.  [I don't have a
copy of the C++ standard, but I did check sections 2.3.4, 2.3.5, and
3.1.4 (which is of especial relevance) of Generic Programming and the
STL by Matt Austern.]

I received compilation errors using both g++ 3.3 and intel c++ for linux
7.1, but oddly enough, MSVC 7.1 compiles the code without complaint.
(Non-compliance issue, or superior QoI?)

I believe that consistent use of std::advance would solve the problem.
Or would this change be so costly that I ought to use vector or deque?
Unfortunately, doing so would cause me other problems such as iterator
invalidation. :-/

Dave

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Dave Gomboc
John Maddock

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved