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

2376. bad_weak_ptr::what() overspecified

Section: 20.3.2.1 [util.smartptr.weak.bad] Status: C++17 Submitter: Jonathan Wakely Opened: 2014-03-27 Last modified: 2017-07-30

Priority: Not Prioritized

View all issues with C++17 status.

Discussion:

[util.smartptr.weakptr] p2 requires bad_weak_ptr to return precisely the string "bad_weak_ptr".

There was general agreement on the reflector and at the Issaquah meeting that this is over-constrained and implementation should be free to return something more descriptive if desired.

The proposed resolution makes bad_weak_ptr consistent with other exception types such as bad_alloc and bad_cast.

If accepted, the P/R for issue 2233(i), which currently uses similar wording to bad_weak_ptr, could be updated appropriately.

[2014-03-27 Library reflector vote]

The issue has been identified as Tentatively Ready based on six votes in favour.

Proposed resolution:

This wording is relative to N3936.

  1. Edit [util.smartptr.weakptr]:

    bad_weak_ptr() noexcept;
    

    -2- Postconditions: what() returns "bad_weak_ptr"an implementation-defined NTBS.