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

944. atomic<bool> derive from atomic_bool?

Section: 32.5.8 [atomics.types.generic] Status: Resolved Submitter: Holger Grund Opened: 2008-12-19 Last modified: 2016-01-28

Priority: Not Prioritized

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

View all issues with Resolved status.

Discussion:

I think it's fairly obvious that atomic<bool> is supposed to be derived from atomic_bool (and otherwise follow the atomic<integral> interface), though I think the current wording doesn't support this. I raised this point along with atomic<floating-point> privately with Herb and I seem to recall it came up in the resulting discussion on this list. However, I don't see anything on the current libs issue list mentioning this problem.

32.5.8 [atomics.types.generic]/3 reads

There are full specializations over the integral types on the atomic class template. For each integral type integral in the second column of table 121 or table 122, the specialization atomic<integral> shall be publicly derived from the corresponding atomic integral type in the first column of the table. These specializations shall have trivial default constructors and trivial destructors.

Table 121 does not include (atomic_bool, bool), so that this should probably be mentioned explicitly in the quoted paragraph.

[ Summit: ]

Move to open. Lawrence will draft a proposed resolution. Also, ask Howard to fix the title.

[ Post Summit Anthony provided proposed wording. ]

[ 2009-10 Santa Cruz: ]

NAD EditorialResolved. Addressed by N2992.

Proposed resolution:

Replace paragraph 3 in 32.5.8 [atomics.types.generic] with

-3- There are full specializations over the integral types on the atomic class template. For each integral type integral in the second column of table 121 or table 122, the specialization atomic<integral> shall be publicly derived from the corresponding atomic integral type in the first column of the table. In addition, the specialization atomic<bool> shall be publicly derived from atomic_bool. These specializations shall have trivial default constructors and trivial destructors.