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.

908. Deleted assignment operators for atomic types must be volatile

Section: 32.5.8[atomics.types.generic]Status:ResolvedSubmitter: Anthony WilliamsOpened: 2008-09-26Last modified: 2017-11-29

Priority:Not Prioritized

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

View all issues withResolved status.

Discussion:

Addresses US 90

The deleted copy-assignment operators for the atomic types are notmarked as volatile in N2723, whereas the assignment operators from theassociated non-atomic types are. e.g.

atomic_bool& operator=(atomic_bool const&) = delete;atomic_bool& operator=(bool) volatile;

This leads to ambiguity when assigning a non-atomic value to anon-volatile instance of an atomic type:

atomic_bool b;b=false;

Both assignment operators require a standard conversions: thecopy-assignment operator can use the implicitatomic_bool(bool)conversion constructor to convertfalse to an instance ofatomic_bool, orb can undergo a qualification conversion in order touse the assignment from a plainbool.

This is only a problem once issue845(i) is applied.

[Summit:]

Move to open. Assign to Lawrence. Related to US 90 comment.

[2009-08-17 Handled byN2925.]

[2009-10 Santa Cruz:]

NAD EditorialResolved. Addressed byN2992.

Proposed resolution:

Add volatile qualification to the deleted copy-assignment operator ofall the atomic types:

atomic_bool& operator=(atomic_bool const&)volatile = delete;atomic_itype& operator=(atomic_itype const&)volatile = delete;

etc.

This will mean that the deleted copy-assignment operator will requiretwo conversions in the above example, and thus be a worse match thanthe assignment from plainbool.


[8]ページ先頭

©2009-2026 Movatter.jp