This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Dup status.

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

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

Priority: Not Prioritized

View all other issues in [string.swap].

View all issues with Dup status.

Duplicate of: 5

Discussion:

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)

Rationale: