Title
weak_ptr comparison functions should be removed
Status
c++11
Section
[util.smartptr.weak]
Submitter
Daniel Krügler

Created on 2009-11-04.00:00:00 last changed 154 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change [util.smartptr.weak]/1 as indicated:

namespace std {
template<class T> class weak_ptr {
public:
...
  // comparisons
  template<class Y> bool operator<(weak_ptr<Y> const&) const = delete;
  template<class Y> bool operator<=(weak_ptr<Y> const&) const = delete;
  template<class Y> bool operator>(weak_ptr<Y> const&) const = delete;
  template<class Y> bool operator>=(weak_ptr<Y> const&) const = delete;
};
...
Date: 2009-11-14.00:00:00

[ 2009-11-14 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]

Date: 2009-11-04.00:00:00

Additional to the necessary cleanup of the description of the the weak_ptr component from [util.smartptr.weak] described in 1231 it turns out that the currently deleted comparison functions of weak_ptr are not needed at all: There is no safe-bool conversion from weak_ptr, and it won't silently chose a conversion to shared_ptr.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg1337
2010-10-21 18:28:33adminsetmessages: + msg1336
2009-11-04 00:00:00admincreate