Boost logo

Boost Users :

From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2006-08-10 06:08:17


In my former post I wrote about assertions in program_options library...

Since nobody answered I had to debug some boost::code. As I found out, current assertion of po
relies in the following:

in the function format_paragraph (option_description.cpp:365) is written:

//...
if (line_begin + (line_length - indent) > par_end)
//...

line_begin is of type std::string::const_iterator;

line_length - indent is 51

in the last line only one word is written, which is shorter then 51 characters. By adding 51 to an
iterator an assertion check is made, that the addition will produce an iterator out of string
bounds. I know that iterators should behave like pointers, but in this case it is impossible to
debug. Would be nice if some of boost developers decide to make a workaround. I will fix it
locally.

With Kind Regards,

Ovanes Markarian


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