Created on 2017-06-15.00:00:00 last changed 46 months ago
Proposed resolution:
This wording is relative to N4659.
Edit [util.smartptr.shared.atomic] as indicated:
template<class T> bool atomic_compare_exchange_weak_explicit( shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w, memory_order success, memory_order failure); template<class T> bool atomic_compare_exchange_strong_explicit( shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w, memory_order success, memory_order failure);[…]
-35- Remarks: Two shared_ptr objects are equivalent if they store the same pointer value and share ownership, or if they store the same pointer value and both are empty. The weak form may fail spuriously. See 32.6.1.
[ 2017-06-26 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]
[util.smartptr.shared.atomic] p35 states that two shared pointers are equivalent if they store the same pointer value, and share ownership. As empty shared pointers never share ownership, it is not possible to replace an empty shared pointer using the atomic compare_exchange API.
Note that through aliasing, empty shared pointers may still point to different objects, and any resolution must allow for that case too.History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2017-11-13 19:01:36 | admin | set | status: voting -> wp |
2017-10-17 18:34:55 | admin | set | status: ready -> voting |
2017-06-26 20:04:47 | admin | set | messages: + msg9293 |
2017-06-26 20:04:47 | admin | set | status: new -> ready |
2017-06-15 17:17:31 | admin | set | messages: + msg9267 |
2017-06-15 00:00:00 | admin | create |