41. Ios_base needs clear(), exceptions()

Section: 30.5.3 [ios.base] Status: TC1 Submitter: Nathan Myers Opened: 1998-08-06 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [ios.base].

View all issues with TC1 status.

Duplicate of: 157


The description of ios_base::iword() and pword() in [ios.members.static], say that if they fail, they "set badbit, which may throw an exception". However, ios_base offers no interface to set or to test badbit; those interfaces are defined in basic_ios<>.

Proposed resolution:

Change the description in [ios.base.storage] in paragraph 2, and also in paragraph 4, as follows. Replace

If the function fails it sets badbit, which may throw an exception.


If the function fails, and *this is a base sub-object of a basic_ios<> object or sub-object, the effect is equivalent to calling basic_ios<>::setstate(badbit) on the derived object (which may throw failure).

[Kona: LWG reviewed wording; setstate(failbit) changed to setstate(badbit).]