2942. LWG 2873's resolution missed weak_ptr::owner_before

Section: 20.3.2.3.6 [util.smartptr.weak.obs] Status: C++20 Submitter: Tim Song Opened: 2017-03-09 Last modified: 2021-02-25

Priority: Not Prioritized

View all other issues in [util.smartptr.weak.obs].

View all issues with C++20 status.

Discussion:

The NB comment asked for noexcept on shared_ptr::owner_before, weak_ptr::owner_before, and owner_less::operator(), but the PR of LWG 2873 only added it to the first and the third one.

[2017-06-03, Moved to Tentatively Ready after 6 positive votes on c++std-lib]

Proposed resolution:

This wording is relative to N4659.

  1. Edit 20.3.2.3 [util.smartptr.weak], class template weak_ptr synopsis, as indicated:

    […]
    // 20.3.2.3.6 [util.smartptr.weak.obs], observers
    […]
    template<class U> bool owner_before(const shared_ptr<U>& b) const noexcept;
    template<class U> bool owner_before(const weak_ptr<U>& b) const noexcept;
    
  2. Edit 20.3.2.3.6 [util.smartptr.weak.obs] immediately before p4 as indicated:

    template<class U> bool owner_before(const shared_ptr<U>& b) const noexcept;
    template<class U> bool owner_before(const weak_ptr<U>& b) const noexcept;
    

    -4- Returns: An unspecified value such that […]