Movatterモバイル変換


[0]ホーム

URL:



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

63. Exception-handling policy for unformatted output

Section: 31.7.6.4[ostream.unformatted]Status:TC1Submitter: Matt AusternOpened: 1998-08-11Last modified: 2016-01-28

Priority:Not Prioritized

View all otherissues in [ostream.unformatted].

View all issues withTC1 status.

Discussion:

Clause 27 details an exception-handling policy for formatted input,unformatted input, and formatted output. It says nothing forunformatted output (27.6.2.6). 27.6.2.6 should either include the samekind of exception-handling policy as in the other three places, orelse it should have a footnote saying that the omission isdeliberate.

Proposed resolution:

In 27.6.2.6, paragraph 1, replace the last sentence ("In anycase, the unformatted output function ends by destroying the sentryobject, then returning the value specified for the formatted outputfunction.") with the following text:

If an exception is thrown during output, thenios::badbit isturned on [Footnote: without causing anios::failure to bethrown.] in*this's error state. If(exceptions() &badbit) != 0 then the exception is rethrown. In any case, theunformatted output function ends by destroying the sentry object,then, if no exception was thrown, returning the value specified forthe formatted output function.

Rationale:

This exception-handling policy is consistent with that of formattedinput, unformatted input, and formatted output.


[8]ページ先頭

©2009-2026 Movatter.jp