Created on 2017-02-03.00:00:00 last changed 89 months ago
Proposed resolution:
This wording is relative to N4640.
Change [util.smartptr.shared.cmp] as depicted:
template<class T, class U> bool operator<(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept;-2- Returns: less<
V>()(a.get(), b.get()), where V is the composite pointer type (Clause 5) of shared_ptr<T>::element_type* and shared_ptr<U>::element_type*.
[ Kona 2017-03-02 ]
Accepted as Immediate to resolve NB comment.
[ 2017-03-02, Kona, STL comments and provides wording ]
We talked about this in LWG, and I talked to Alisdair. The status quo is already maximally general (operator less-than in Core always forms a composite pointer type), but we can use diamond-less to significantly simplify the specification. (We can't use less-than directly, due to the total ordering issue, which diamond-less was recently "upgraded" to handle.)
The less-than operator for shared pointers compares only those combinations that can form a composite pointer type. With the C++17 wording for the diamond functor, less<>, we should be able to support comparison of a wider range of shared pointers, such that less<>::operator(shared_ptr<A>, shared_ptr<B>) is consistent with less<>::operator(A *, B *).
Proposed change: Replace less<V> with just less<>, and drop the reference to composite pointer types.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2017-03-05 23:46:08 | admin | set | status: immediate -> wp |
2017-03-03 22:08:49 | admin | set | messages: + msg9062 |
2017-03-03 22:08:49 | admin | set | status: new -> immediate |
2017-03-02 17:01:50 | admin | set | messages: + msg9036 |
2017-03-02 17:01:50 | admin | set | messages: + msg9035 |
2017-02-03 00:00:00 | admin | create |