Boost logo

Boost Users :

From: samantha Quark (loeffel77_at_[hidden])
Date: 2005-02-01 16:30:09


Dear all,
 I just played a little bit with the
regex_token_iterator ( boost v 1.32) and modified the
"html" example.
I found this (strange?) behavior when i "tokenize" a
string.

while (i != j)
{
  std::cout << i++->str().length() << std::endl;
}

crashes at runtime at the last sub-match of a match
with:
mtest: ../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: 24497 abort mtest test.html

Whereas:

while (i != j)
{
  std::cout << i->str().length() << std::endl;
  i++;
}

works fine.

Is this behavior a bug, or is it correct, that the
first version does not work, if yes, why?

Cheers, Joe.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


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