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

### 2003. String exception inconsistency in erase.

Section: 23.4.3.2 [string.require] Status: C++14 Submitter: José Daniel García Sánchez Opened: 2010-10-21 Last modified: 2016-11-12

Priority: 0

View all other issues in [string.require].

View all issues with C++14 status.

Discussion:

Clause 21.4.1 [string.require]p3 states:

> No `erase()` or `pop_back()` member function shall throw any exceptions.

However in 21.4.6.5 [string.erase] p2 the first version of `erase` has

> Throws: `out_of_range` if `pos > size()`.

[2011-03-24 Madrid meeting]

Beman: Don't want to just change this, can we just say "unless otherwise specified"?

Alisdair: Leave open, but update proposed resolution to say something like "unless otherwise specified".

General agreement that it should be corrected but not a stop-ship.

Action: Update proposed wording for issue 2003 as above, but leave Open.

[2014-02-12 Issaquah meeting]

Jeffrey: Madrid meeting's proposed wording wasn't applied, and it's better than the original proposed wording. However, this sentence is only doing 3 functions' worth of work, unlike the similar paragraphs in 24.2.2.1 [container.requirements.general]. Suggest just putting "Throws: Nothing" on the 3 functions.

[2014-02-13 Issaquah meeting]

Move as Immmediate

Proposed resolution:

Remove [string.require]p/3:

> 3 No `erase()` or `pop_back()` member function shall throw any exceptions.

Add to the specifications of `iterator erase(const_iterator p);`, `iterator erase(const_iterator first, const_iterator last);`, and `void pop_back();` in 23.4.3.7.5 [string.erase]:

> Throws: Nothing