|
Boost Users : |
From: Joe (loeffel77_at_[hidden])
Date: 2005-02-02 13:53:07
> I can't reproduce that, can you provide test case?
Obviously my problem seems to be a little more subtile
than i thought. I wrapped my example to a (actually
three) stand alone program:
#include <iostream>
#include <iterator>
#include <string>
#include <boost/regex.hpp>
boost::regex
e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\">",
boost::regex::normal |
boost::regbase::icase);
int main(int argc, char** argv)
{
std::string s("<a href=\"mytest\"> hallo <\\a>\n"
"<a href=\"duda\"> fjdu <\\a>\n");
const int subs[] = {1,0,};
boost::sregex_token_iterator i(s.begin(), s.end(),
e, subs);
boost::sregex_token_iterator j;
while(i != j)
{
#ifdef USE_1
std::cout << i->length() << i++->str().length() <<
std::endl;
#endif
#ifdef USE_2
std::cout << i->length() << i->str().length() <<
std::endl;
i++;
#endif
#ifdef USE_3
std::cout << i->length() ;
std::cout << i++->str().length() <<
std::endl;
#endif
}
return 0;
}
Suprisingly the "use_1" version is the only one that
crashes with the output:
176
417
154
u1: ../boost_1_32_0/boost/shared_ptr.hpp:253: T*
boost::shared_ptr<T>::operator->() const [with T =
boost::regex_token_iterator_implementation<__gnu_cxx::__normal_iterator<const
char*, std::basic_string<char, std::char_traits<char>,
std::allocator<char> > >, char,
boost::regex_traits<char>, std::allocator<char> >]:
Assertion `px != 0' failed.
zsh: 31069 abort ./u1
I hope this is not a bug of my strange gcc (v3.3.3)
version, and you can reproduce the error.
Cheers, Joe.
__________________________________
Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250
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