This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of WP status.
Section: D.12 [depr.util.smartptr.shared.atomic] Status: WP Submitter: Alisdair Meredith Opened: 2017-06-15 Last modified: 2017-12-02
Priority: Not Prioritized
View all other issues in [depr.util.smartptr.shared.atomic].
View all issues with WP status.
[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.
[ 2017-06-26 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]
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. The weak form may fail spuriously. See 32.6.1.