Created on 2010-08-25.00:00:00 last changed 171 months ago
Proposed resolution:
Add the following overloads to [atomics.types.generic], the synopsis around the specialization atomic<T*>, as indicated:
namespace std { [..] template <class T> struct atomic<T*> : atomic_address { [..] }; template<typename T> void atomic_store(atomic<T*>&,T*); template<typename T> void atomic_store(atomic<T*>&,void*) = delete; template<typename T> void atomic_store_explicit(atomic<T*>&,T*,memory_order); template<typename T> void atomic_store_explicit(atomic<T*>&,void*,memory_order) = delete; template<typename T> T* atomic_exchange(atomic<T*>&,T*); template<typename T> T* atomic_exchange(atomic<T*>&,void*) = delete; template<typename T> T* atomic_exchange_explicit(atomic<T*>&,T*,memory_order); template<typename T> T* atomic_exchange_explicit(atomic<T*>&,void*,memory_order) = delete; template<typename T> T* atomic_compare_exchange_weak(atomic<T*>&,T**,T*); template<typename T> T* atomic_compare_exchange_weak(atomic<T*>&,void**,void*) = delete; template<typename T> T* atomic_compare_exchange_weak_explicit(atomic<T*>&,T**,T*,memory_order); template<typename T> T* atomic_compare_exchange_weak_explicit(atomic<T*>&,void**,void*,memory_order) = delete; template<typename T> T* atomic_compare_exchange_strong(atomic<T*>&,T**,T*); template<typename T> T* atomic_compare_exchange_strong(atomic<T*>&,void**,void*) = delete; template<typename T> T* atomic_compare_exchange_strong_explicit(atomic<T*>&,T**,T*,memory_order); template<typename T> T* atomic_compare_exchange_strong_explicit(atomic<T*>&,void**,void*,memory_order) = delete; }
[ Resolved in Batavia by accepting n3193. ]
Addresses GB-133
The free functions that operate on atomic_address can be used to store a pointer to an unrelated type in an atomic<T*> without a cast. e.g.
int i; atomic<int*> ai(&i); string s; atomic_store(&ai,&s);
Overload the atomic_store, atomic_exchange and atomic_compare_exchange_[weak/strong] operations for atomic<T*> to allow storing only pointers to T.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-11-18 12:46:23 | admin | set | status: nad editorial -> resolved |
2010-11-13 02:14:14 | admin | set | messages: + msg5350 |
2010-11-13 02:14:14 | admin | set | status: open -> nad editorial |
2010-10-27 21:43:25 | admin | set | messages: + msg5174 |
2010-10-21 19:47:27 | admin | set | messages: + msg4867 |
2010-08-25 00:00:00 | admin | create |