id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 358,parse_date asserts on empty string,nobody,az_sw_dude,"{{{ the following sample code fails with assert : (Assertion failed: valid_, file c:\dev\externallibs\boost_1_32_0\boost\token_iter ator.hpp, line 57) >>> #include #include using namespace boost::gregorian; int main( int, char** ) { try { date d = from_simple_string( """" ); // never reached std::cout << to_simple_string( d ) << std::endl; } catch( std::exception & ) { // no std::exception caught ! } return 0; } >>> The error seems to be in date_time\date_parsing.hpp, line 119 : for(boost::tokenizer<>::iterator beg=tok.begin(); beg!=tok.end(), pos < spec_str.size(); ++beg, ++pos) {... the comparison ""beg!=tok.end()"" has no effect because the value of the expression is only determined by ""pos < spec_str.size()"". Therefore the string iteration goes beyond the end of the string and...assert... The function also fails if the given string is not a complete date, ie: ""2004"", ""2004-Jan"" I changed the "","" to ""&&"" and it seems to perform better (though i didn't run the boost regression tests). I also checked the CVS repository to confirm the bug is still there. Have a nice day ! and thanks for this great library, it is really good to develop with it. Here is my email : guillaume.souchet@bnpparibas.com }}}",Bugs,closed,,date_time,None,,Fixed,,