Boost C++ Libraries: Ticket #4708: regex::sub_match::length() https://svn.boost.org/trac10/ticket/4708 <p> code does not match documentation. if matched==false length() does not return 0, instead it results in an assertion of "string iterators incompatible" docs state: </p> <pre class="wiki">static difference_type length(); Effects: returns the length of this matched sub-expression, or 0 if this sub-expression was not matched: matched ? distance(first, second) : 0). </pre><p> Checked the source, code is broke. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4708 Trac 1.4.3 robin.snyder@… Mon, 04 Oct 2010 19:22:29 GMT summary changed; keywords set https://svn.boost.org/trac10/ticket/4708#comment:1 https://svn.boost.org/trac10/ticket/4708#comment:1 <ul> <li><strong>keywords</strong> regex sub_match length added </li> <li><strong>summary</strong> <span class="trac-field-old">reges::sub_match::length()</span> → <span class="trac-field-new">regex::sub_match::length()</span> </li> </ul> Ticket robin.snyder@… Mon, 04 Oct 2010 20:49:14 GMT <link>https://svn.boost.org/trac10/ticket/4708#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4708#comment:2</guid> <description> <p> this also affects the .str() method. if you call match<a class="missing wiki">missing</a>.str() and there is no such named group, it fails with the same assert. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Wed, 06 Oct 2010 10:50:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4708#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4708#comment:3</guid> <description> <p> Confirmed, testing fix now... </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 07 Oct 2010 07:24:07 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4708#comment:4 https://svn.boost.org/trac10/ticket/4708#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/65800" title="Stop accessing/comparing singular iterators. Fixes #4708.">[65800]</a>) Stop accessing/comparing singular iterators. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4708" title="#4708: Bugs: regex::sub_match::length() (closed: fixed)">#4708</a>. </p> Ticket