1468. atomic_address::compare_exchange_* member functions should match atomic_compare_exchange_* free functions

Section: 99 [atomics.types.address] Status: Resolved Submitter: INCITS Opened: 2010-08-25 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [atomics.types.address].

View all issues with Resolved status.

Discussion:

Addresses US-164

atomic_address has member functions compare_exchange_weak and compare_exchange_strong that take arguments of type const void*, in addition to the void* versions. If these member functions survive, there should be corresponding free functions.

[ 2010-10-27 Daniel adds: ]

Accepting n3164 would solve this issue differently by removing the overloads with const void* arguments, because they break type-safety.

[ Resolved in Batavia by accepting n3193. ]

Proposed resolution:

Extend the synopsis around atomic_address in 99 [atomics.types.address] as indicated:

namespace std {
  [..]
  bool atomic_compare_exchange_weak(volatile atomic_address*, void**, void*);
  bool atomic_compare_exchange_weak(atomic_address*, void**, void*);
  bool atomic_compare_exchange_strong(volatile atomic_address*, void**, void*);
  bool atomic_compare_exchange_strong(atomic_address*, void**, void*);
  bool atomic_compare_exchange_weak_explicit(volatile atomic_address*, void**, void*,
    memory_order, memory_order);
  bool atomic_compare_exchange_weak_explicit(atomic_address*, void**, void*,
    memory_order, memory_order);
  bool atomic_compare_exchange_strong_explicit(volatile atomic_address*, void**, void*,
    memory_order, memory_order);
  bool atomic_compare_exchange_strong_explicit(atomic_address*, void**, void*,
    memory_order, memory_order);
  bool atomic_compare_exchange_weak(volatile atomic_address*, const void**, const void*);
  bool atomic_compare_exchange_weak(atomic_address*, const void**, const void*);
  bool atomic_compare_exchange_strong(volatile atomic_address*, const void**, const void*);
  bool atomic_compare_exchange_strong(atomic_address*, const void**, const void*);
  bool atomic_compare_exchange_weak_explicit(volatile atomic_address*, const void**, const void*,
    memory_order, memory_order);
  bool atomic_compare_exchange_weak_explicit(atomic_address*, const void**, const void*,
    memory_order, memory_order);
  bool atomic_compare_exchange_strong_explicit(volatile atomic_address*, const void**, const void*,
    memory_order, memory_order);
  bool atomic_compare_exchange_strong_explicit(volatile atomic_address*, const void**, const void*,
    memory_order, memory_order);
  bool atomic_compare_exchange_strong_explicit(atomic_address*, const void**, const void*,
    memory_order, memory_order);
  [..]
}