87. Error in description of string::compare()

Section: [string.swap] Status: Dup Submitter: Nico Josuttis Opened: 1998-09-29 Last modified: 2016-11-12 20:15:11 UTC

Priority: Not Prioritized

View all other issues in [string.swap].

View all issues with Dup status.

Duplicate of: 5


The following compare() description is obviously a bug:

int compare(size_type pos, size_type n1, 
            charT *s, size_type n2 = npos) const;

because without passing n2 it should compare up to the end of the string instead of comparing npos characters (which throws an exception)