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.

108. Lifetime of exception::what() return unspecified

Section: 17.7.3[type.info]Status:TC1Submitter: AFNOROpened: 1998-10-07Last modified: 2016-01-28

Priority:Not Prioritized

View all otherissues in [type.info].

View all issues withTC1 status.

Discussion:

In 18.6.1, paragraphs 8-9, the lifetime of the return value ofexception::what() is left unspecified. This issue has implicationswith exception safety of exception handling: some exceptions shouldnot throw bad_alloc.

Proposed resolution:

Add to 17.7.3[type.info] paragraph 9 (exception::what notesclause) the sentence:

The return value remains valid until the exception object from which it is obtained is destroyed or a non-const member function of the exception object is called.

Rationale:

If an exception object has non-const members, they may be usedto set internal state that should affect the contents of the stringreturned bywhat().


[8]ページ先頭

©2009-2025 Movatter.jp