Movatterモバイル変換


[0]ホーム

URL:



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

2083. const-qualification onweak_ptr::owner_before

Section: 20.3.2.3[util.smartptr.weak], 20.3.2.3.6[util.smartptr.weak.obs]Status:C++14Submitter: Ai AzumaOpened: 2011-09-06Last modified: 2016-01-28

Priority:Not Prioritized

View all otherissues in [util.smartptr.weak].

View all issues withC++14 status.

Discussion:

Is there any reason whyweak_ptr::owner_before member function templates are not const-qualified?

Daniel Krügler:

I don't think so. To the contrary, without these to be const member function templates, thesemantics of the specializationsowner_less<weak_ptr<T>> andowner_less<shared_ptr<T>> described in 20.3.2.4[util.smartptr.ownerless] is unclear.

It is amusing to note that this miss has remain undetected from the accepted papern2637 on. For the suggested wording changes see below.

[2012, Kona]

Move to Ready.

[2012, Portland: applied to WP]

Proposed resolution:

This wording is relative to the FDIS.

  1. Change the class templateweak_ptr synopsis in 20.3.2.3[util.smartptr.weak]as indicated:

    namespace std {  template<class T> class weak_ptr {  public:    typedef T element_type;    […]    template<class U> bool owner_before(shared_ptr<U> const& b)const;    template<class U> bool owner_before(weak_ptr<U> const& b)const;  };  […]}
  2. Change the prototypes in 20.3.2.3.6[util.smartptr.weak.obs] before p6 as indicated:

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

[8]ページ先頭

©2009-2026 Movatter.jp