Boost logo

Boost Users :

From: The Grumpiest Man You Know (mrgrumpyguts_at_[hidden])
Date: 2005-02-21 20:01:18


On Mon, 21 Feb 2005 12:23:03 -0000, John Maddock <john_at_[hidden]> wrote:
> > The reason the code I sent "hangs" is because it's iterating over a
> > zero length match.
> > which consumes 0 characters of input per loop. I must do that once a
> > year in any language I use, you think I'd learn huh?
>
> If you'd used regex_iterator or regex_token_iterator then they would have
> taken care of that special case for you, and it wouldn't have gone round and
> round

Cheers John but I couldn't work out from the docs how to do much with
regex at all. I'm afraid the language is too grown up. :) After
trawling through the tests and stuff I could see enough to get code to
compile but I've got a long way to go before I can wrap my head around
the regex description.

> > If I can reproduce the segfault and I can't see why it's my fault, can
> > I post that too? Or can we skip that and have y'all start channeling
> > me the clues now. :)
>
> Please do, make sure it's not down to referencing temporary objects after
> they've gone out of scope (that's the most common cause of segfaults around
> here).

Thanks for the pointer, I don't THINK it was a scope problem because I
basically pasted the first loop and tried to change it to use a
regex_finder. Once I figured out that, despite the way I read the
string algo pages, regex_finder woudln't take a string it confused my
that one loop worked and the other segfaulted as soon as it tried to
increment the iterator.

BTW is there any way to get more concise output from gdb when I'm
trying to find myself in a c++/boost session?

-- 
Blue Skies

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