Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofResolved status.

1466. Silentconst breakage bycompare_exchange_* member functions

Section: 99 [atomics.types.address]Status:ResolvedSubmitter: INCITSOpened: 2010-08-25Last modified: 2016-01-28

Priority:Not Prioritized

View all otherissues in [atomics.types.address].

View all issues withResolved status.

Discussion:

Addresses US-162

Thecompare_exchange_weak andcompare_exchange_strong member functions that takeconst void* arguments lead to a silent removal ofconst, because theload member function and other acessors return the stored value as avoid*.

[Proposed resolution as of NB comment:]

Change 99 [atomics.types.address], classatomic_address synopsis, as indicated:

namespace std {  typedef struct atomic_address {    [..]bool compare_exchange_weak(const void*&, const void*,      memory_order, memory_order) volatile;bool compare_exchange_weak(const void*&, const void*,      memory_order, memory_order);bool compare_exchange_strong(const void*&, const void*,      memory_order, memory_order) volatile;bool compare_exchange_strong(const void*&, const void*,      memory_order, memory_order);bool compare_exchange_weak(const void*&, const void*,      memory_order = memory_order_seq_cst) volatile;bool compare_exchange_weak(const void*&, const void*,      memory_order = memory_order_seq_cst);bool compare_exchange_strong(const void*&, const void*,      memory_order = memory_order_seq_cst) volatile;bool compare_exchange_strong(const void*&, const void*,      memory_order = memory_order_seq_cst);    [..]  } atomic_address;  [..]}

[2010-10-27 Daniel adds:]

Acceptingn3164 would solve this issue by replacingatomic_address byatomic<void*>.

[Resolved in Batavia by acceptingn3193.]

Proposed resolution:

Solved byn3193.


[8]ページ先頭

©2009-2026 Movatter.jp