Boost C++ Libraries: Ticket #6540: Erroneous default argument in basic_string::compare overload https://svn.boost.org/trac10/ticket/6540 <p> basic_string in string.hpp contains the following definition: </p> <pre class="wiki">int compare(size_type pos1, size_type n1, const CharT* s, size_type n2 = npos) const {...} </pre><p> However, n2 should not have a default argument. It interferes with calling "int compare(size_type pos1, size_type n1, const CharT* s) const", and a value of npos makes no sense for n2 anyway (it would mean the passed c string had "infinite" length). </p> <p> Thank you, Erik Jensen </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6540 Trac 1.4.3 Ion Gaztañaga Sat, 11 Feb 2012 18:37:11 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6540#comment:1 https://svn.boost.org/trac10/ticket/6540#comment:1 <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> Thanks for the report, fixed in both release and trunk branches at revisions 76985 &amp; 76986. </p> Ticket